In my Drupal 8 site I have people nodes. Each one is linked with one or more book nodes. And each book has a year field.
Using the Search API, I want to search by book name and two years (min and max) and get the name of the person who has a book with the year between those two.
If I index the fields 'Person > Book' and 'Person > Book > Year', these filters are independent. For instance, the year index table in the database is like this:
item_id value
--------------------------
entity:node/17799 1994
entity:node/17799 2001
Each person node is related with all the years from its books, but the books and years are not related.
Now, if I search a book title between two years, I get the person who has either a book with those words or a book within the years.
Is there a way to link the book with the year in the index?