Copied to clipboard

Flag this post as spam?

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


  • Murray Roke 503 posts 966 karma points c-trib
    May 16, 2013 @ 02:33
    Murray Roke
    0

    How do I use Examine to Merge Node Data and Media Data into a single Lucene document

    I have media (PDFs) that I want indexed in lucene, however I want to merge some data from the content where they're attached.

    1) I want to take the 'path' from the content node where it's attached and include it in the lucene document so that I can search parts of the sub-tree for those attachments.

    2) include the nodeTypeAlias from the content node in order to filter on this also.

    Documents may need to be indexed more than once if attached at more than one place

    Note: I want separate results for pdf and content node, so I don't want to merge them completely.

    In umbraco 4.0.3 we had a buggy hack to manually create lucene docuemnts by calling the following:

    this.SaveDeleteIndexQueueItem(new KeyValuePair(IndexNodeIdFieldName, media.Id.ToString()));
  • Murray Roke 503 posts 966 karma points c-trib
    May 16, 2013 @ 06:34
    Murray Roke
    0

    I think we can drop the idea that docuements need to be indexed more than once, because we can simple concatenate the paths into one field on the same lucene document, we only use this data like so

    query = query.And().Field("ParentPathSpaced", CategoryId.ToString());

    Ditto for the nodeTypeAlias

Please Sign in or register to post replies

Write your reply to:

Draft