I'm using Laravel/scout to update the search Algolia. In my Laravel, i have a model named "Content" with many type (articles, actualities, documentations...etc) and for every type, i create an index in Algolia. Is it possible to update each index from one model? If not, is it possible to skirt scout and update algolia with this command (which i tried and didnt work on laravel): $index->saveObjects Thank you;
Scout Indexing - many-to-many relationships
Hi, hope someone can help:
I have to following construct with 3 Models:
Model A has a many-to-many relationship with Model B and Model B has a many-to-many relationship with Model C
A >--< B >--< C
Thus data can look like:
A1 -> B1 -> C1
A1 -> B1 -> C2
A2 -> B1 -> C3
the numbers next to the A,B,C represent for example the primary keys of those models. There are pivot tables inbetween A,B and C.
I would like to for example to index: A->name, A->body,B->name,B->body,C->name,C->body
C will be the main searchable model, so multiples of C should be possible to be returned and each with their associated model foreign keys to B and A so that a list of the available combinations can be shown to the user.
Typically on a routing side its called nested resources, thus you need all three ID's to get to a specific resource instance e.g.
/A/{id_of_a}/B/{id_of_b}/C/{id_of_c}
Use case could be for example ... Book >-< Chapter >-< Paragraph.
So a Paragraph can be re-used in other Chapters and a Chapter can be reused in other books. So when searching for a paragraph by name e.g. the search term could be e.g. "paragraph name" the result could be that: (Paragraph A, chapter 1, Book 2) or (Paragraph A, Chapter 7, Book 15).
Any ideas?
Please or to participate in this conversation.