Copied to clipboard

Flag this post as spam?

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


  • Ben Grice 24 posts 176 karma points
    May 23, 2016 @ 15:02
    Ben Grice
    0

    Search all fields of all documents which are children of a list of parents

    Hi there,

    Our site has the following 4 top level nodes:

    1 - Home 1 (Language 1)
    2 - Home 2 (Language 2)
    3 - Discuss (Bilingual)
    4 - Buy (Bilingual)
    

    Depending on whether the user is on a Language 1 or Language 2 page, I would like to search all of the fields of all of the documents of all children of (1, 3, 4) or (2, 3, 4).

    Up until now I have been using a very basic search, where the user simply enters a value "query" into a text box:

    IEnumerable<IPublishedContent> c = Umbraco.TypedSearch(query);
    

    This would be ideal, apart from that it scans all of the documents, and does not exclude documents which are children of 1 or 2, depending on the language.

    Is believe that I need to set up an Examine Search Provider and an Examine Index for Language 1 and Language 2, but I'm not sure how to set up multiple IndexParentId values, nor, how to scan all of the fields in all documents.

    Could anyone point me in the right direction?

    I realise that scanning all the fields may not always be a good idea, however we currently have many different fieldsnames for the sections containing "content" in our doc types, so right now this is the best approach for me.

Please Sign in or register to post replies

Write your reply to:

Draft