Copied to clipboard

Flag this post as spam?

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


  • John Hodgkinson 613 posts 355 karma points
    Sep 21, 2011 @ 17:52
    John Hodgkinson
    0

    Umbraco Examine Search across multiple sites...

    I'm currently searching across multiple sites but what to add a dropdown that lists the websites to search. How can I go about only returning search results for a specific site vs all of the sites in the index? Many thanks in advance!

  • Owen 123 posts 246 karma points
    Sep 21, 2011 @ 18:17
    Owen
    0

    1. does multiple sites with one umbraco instance?

    2. how about add an aditional search condition(such as node path) to narrow down your search

    3. You can customize your index process, and an aditional value to index(such as website name)

  • John Hodgkinson 613 posts 355 karma points
    Sep 21, 2011 @ 18:22
    John Hodgkinson
    0

    Owen - thx for the replay... in the multiple site drop down list I'm storing the site node id as the value so I'm thinking I can use the "path" property to identify the current pages to display. I'm new to examine so I'm just having trouble getting the search criteria to work, below is where I'm currently at: 

    Examine.SearchCriteria.ISearchCriteria query = searchCriteria.Field("path", "-1," + ddl_site2search.SelectedValue).And().Field("bodyText", tbx_searchTerm.Text).Or().Field("pageTitle", tbx_searchTerm.Text).Or().Field("navTitle", tbx_searchTerm.Text).Compile();

    but it's not working for a path such as -1,1418,1428,2525,6244,6256

  • Owen 123 posts 246 karma points
    Sep 21, 2011 @ 18:30
    Owen
    0

    for example, you have a english website, all contents under the node1, and the path of node1 is "-1, 1110".

    now, you can use "path:-1,1110*" to shrink your search range. It is PrefixQuery in lucene.

  • John Hodgkinson 613 posts 355 karma points
    Sep 21, 2011 @ 18:50
    John Hodgkinson
    0

    Owen - how can I apply that to the above query object? many thanks!

  • John Hodgkinson 613 posts 355 karma points
    Sep 27, 2011 @ 13:57
Please Sign in or register to post replies

Write your reply to:

Draft