R贸bert Boros
06/23/2022, 10:36 AM{
"id": "random_id_1",
"name": "John Doe",
"read_history": [
{
"id": "random_book_id_1",
"name": "Harry Potter and the Philosopher's Stone",
"author": "J. K. Rowling"
},
{
"id": "random_book_id_2",
"name": "Ready Player One",
"author": "Ernest Cline"
}
],
"favorite_books": [
"random_book_id_2"
]
}
So here is an example, what I want to do. As result I want to display my readers and their favourite book names in a table, but I want to search in author names and book names as well.
In the different index idea, I planned create two indexes, first for general reader data (id, name, favorite_books) and the second would store the read history data with an extra owner_id field to connect the book document to the reader. The indexing was just fine in this case, if I ran a multi collection search I got the results in two different collections, but I want to paginate in the general reader data (and in optimal case, the book data should follow it, based on the shared id, like a SQL join) and not separately. Is there any chance I can do it with Typesense, or I have to merge (fetch and then aggregate) my objects manually?Kishore Nallan
06/23/2022, 11:50 AMread_history.names: ["Harry Potter and the Philosopher's Stone", "Ready Player One"]
read_history.authors: ["J. K. Rowling", "Ernest Cline"]
R贸bert Boros
06/23/2022, 11:52 AMR贸bert Boros
06/24/2022, 8:38 AMKishore Nallan
06/24/2022, 8:43 AMR贸bert Boros
06/24/2022, 8:43 AM