Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Proxicode 127 posts 323 karma points
    Jun 24, 2015 @ 02:12
    Proxicode
    0

    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

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jun 24, 2015 @ 04:36
    Nathan Woulfe
    0

    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:

    <add name="SearchIndexer" type="Your.Namespace.CustomIndexer, Your.Namespace" ...
    
  • Shannon Deminick 1524 posts 5269 karma points MVP 2x
    Jun 24, 2015 @ 09:33
    Shannon Deminick
    100

    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

    Jun 24, 2015 @ 11:30
  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jun 24, 2015 @ 11:56
    Nathan Woulfe
    0

    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?

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jun 24, 2015 @ 13:30
    Ismail Mayat
    0

    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

  • Raghav 34 posts 103 karma points
    Oct 24, 2015 @ 16:25
    Raghav
    0

    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

  • Al Nicholl 15 posts 97 karma points
    Sep 12, 2016 @ 10:20
    Al Nicholl
    0

    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

  • Raghav 34 posts 103 karma points
    Sep 13, 2016 @ 04:14
    Raghav
    0

    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

  • Al Nicholl 15 posts 97 karma points
    Sep 13, 2016 @ 04:58
    Al Nicholl
    0

    Yep thought so. I've had to do the same. Thanks anyway.

  • Comment author was deleted

    Oct 05, 2017 @ 21:08

    For any late-comers, here's a video for this sort of thing: https://www.youtube.com/watch?v=526X0B_sqFw

Please Sign in or register to post replies

Write your reply to:

Draft