Combining Examine searches based on Multi-node picker values
Hi all,
I have another fairly large search that needs to be much faster and I was hoping someone here might be able to help.
As it stands, I have a database of books. Each book must have at least one author but could have any number. Book items and authors are both stored as nodes and a book knows who it's authors are via a multi-node picker stored as a csv (it must be csv due to the import method...)
If you want to do a generic search on the site, it needs to only bring back books but it also needs to be awayre of the author.
So, for example, if you were to search all books for "Smith" it'd need to return every book with the word "Smith" in the title but also every book written by anyone called "Smith". Currently, the site searches books first, searches authors next and then checks every single book in the system against the author search result to see which books are written by (or co-written by) an author named "Smith".
It does this by creating a DynamicNodeList of the all books and checks if the "authors" property contains the id of the authors brought back in the search. Further, for all new matches, it has to check that the book doesn't already exist in the search results. So, as you can imagine, with a large number of books and authors this is a very slow process. Is there a way to acheive this with just one examine search?
This may be related to another query I have with Examine here.
Take a look at my video (http://umbracoukfestival.co.uk/videos-photos/ you can also download the slides) presentation from recent umbraco festival namely the bit on using gatheringnode data event and the food for thought section where I take about potentially serialising related data and storing in the index.
So in your case create gathering node data event and for each book get related authors from the multi tree node picker field instantiate the node factory node and get the author text then shove that in the index record for that book. This way the authors field is now searchable.
Combining Examine searches based on Multi-node picker values
Hi all,
I have another fairly large search that needs to be much faster and I was hoping someone here might be able to help.
As it stands, I have a database of books. Each book must have at least one author but could have any number. Book items and authors are both stored as nodes and a book knows who it's authors are via a multi-node picker stored as a csv (it must be csv due to the import method...)
If you want to do a generic search on the site, it needs to only bring back books but it also needs to be awayre of the author.
So, for example, if you were to search all books for "Smith" it'd need to return every book with the word "Smith" in the title but also every book written by anyone called "Smith". Currently, the site searches books first, searches authors next and then checks every single book in the system against the author search result to see which books are written by (or co-written by) an author named "Smith".
It does this by creating a DynamicNodeList of the all books and checks if the "authors" property contains the id of the authors brought back in the search. Further, for all new matches, it has to check that the book doesn't already exist in the search results. So, as you can imagine, with a large number of books and authors this is a very slow process. Is there a way to acheive this with just one examine search?
This may be related to another query I have with Examine here.
Thanks for looking
Alex
Alex,
Take a look at my video (http://umbracoukfestival.co.uk/videos-photos/ you can also download the slides) presentation from recent umbraco festival namely the bit on using gatheringnode data event and the food for thought section where I take about potentially serialising related data and storing in the index.
So in your case create gathering node data event and for each book get related authors from the multi tree node picker field instantiate the node factory node and get the author text then shove that in the index record for that book. This way the authors field is now searchable.
Regards
Ismail
is working on a reply...