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 - 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:
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!
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)
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
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.
Owen - how can I apply that to the above query object? many thanks!
I was able to get it working using the GatheringNodeDataHandler event based on the info in these posts...
http://our.umbraco.org/forum/developers/extending-umbraco/11659-Examine-quering-path
http://farmcode.org/post/2010/09/22/Searching-Multi-Node-Tree-Picker-data-(or-any-collection)-with-Examine.aspx
is working on a reply...