I have a site with Examine/Lucene searching and it works as expected on normal document types, but it fails to find any content which is nested in Archetype.
This makes sense to me as there is no way for the indexer to "know" what is in the nested properties, but it there a way to instruct the indexer of the relationship?
You're right, the indexers don't know what they should be indexing, so you need to tell it explicitly - without knowing exactly how you've set up the package, hopefully this gist helps.
Once you've got the indexer up and running, reference it in ExamineSettings.config:
You don't need a custom indexer to do that, you should just use events. There are two you can use:
GatheringNodeData - which allows you to modify the dictionary of items before it get's passed to lucene. However, if you have explicit fields defined in your index, you cannot just add additional fields to this dictionary since they will be filtered out... so you can either add these custom fields to your explicit index fields in config, or don't define explicit fields.
DocumentWriting - this is a lower level event that allows you to modify the Lucene document before it get's written, so you can put whatever you want into the index.
Not sure why we aren't doing it using events - we're using the OnGatheringNodeData event to perform a stack of other data manipulation, but not this one.
What would be a use case for a custom indexer? Indexing data from a third party?
Custom indexer is exactly for third party, so sql server / mysql [insert you tech here] you write your own indexer by implementing an interface there is example sql server custom indexer in examine code on github.
Did you ever find a solution to this? I've got an index with individual Archetype properties listed but, like you, searching only returns the page the Archetype data type is used on.
Examine/Lucene & Archetype
Hi All,
I have a site with Examine/Lucene searching and it works as expected on normal document types, but it fails to find any content which is nested in Archetype.
This makes sense to me as there is no way for the indexer to "know" what is in the nested properties, but it there a way to instruct the indexer of the relationship?
Thanks!
-Roger
Hi Roger
You're right, the indexers don't know what they should be indexing, so you need to tell it explicitly - without knowing exactly how you've set up the package, hopefully this gist helps.
Once you've got the indexer up and running, reference it in ExamineSettings.config:
You don't need a custom indexer to do that, you should just use events. There are two you can use:
GatheringNodeData - which allows you to modify the dictionary of items before it get's passed to lucene. However, if you have explicit fields defined in your index, you cannot just add additional fields to this dictionary since they will be filtered out... so you can either add these custom fields to your explicit index fields in config, or don't define explicit fields.
DocumentWriting - this is a lower level event that allows you to modify the Lucene document before it get's written, so you can put whatever you want into the index.
Comment author was deleted
Yep, like Shannon mentioned, use GatheringNodeData: https://github.com/kgiszewski/LearnUmbraco7/blob/master/Chapter%2009%20-%20Searching%20with%20Examine/01%20-%20Built-in%20Functionality.md#complex-property-values
Not sure why we aren't doing it using events - we're using the OnGatheringNodeData event to perform a stack of other data manipulation, but not this one.
What would be a use case for a custom indexer? Indexing data from a third party?
Nathan,
Custom indexer is exactly for third party, so sql server / mysql [insert you tech here] you write your own indexer by implementing an interface there is example sql server custom indexer in examine code on github.
Regards
Ismail
Hi,
I have been able to build the the index on the archetype fieldsets by referring this link https://github.com/kgiszewski/LearnUmbraco7/blob/master/Chapter%2009%20-%20Searching%20with%20Examine/02%20-%20Search%20Results.md But when I actually invoke the search query , it gives me the node which has the archetype property. But I was looking at is to get the filtered fieldsets from that archetype property. Can someone please help me .
Regards Raghav
Hi Raghav,
Did you ever find a solution to this? I've got an index with individual Archetype properties listed but, like you, searching only returns the page the Archetype data type is used on.
Thanks,
Al
Hi,
Nopes I did not. Eventually had to dump the arch type model for that scenario and use native data type as I had to get the indexing working.
Regards Raghav
Yep thought so. I've had to do the same. Thanks anyway.
Comment author was deleted
For any late-comers, here's a video for this sort of thing: https://www.youtube.com/watch?v=526X0B_sqFw
is working on a reply...