Is there any way get my search only to return results from a single site when I have multiple sites set up. I have a site copied for translation and it is picking up them.
var criteria = ExamineManager.Instance .SearchProviderCollection[Index] .CreateSearchCriteria();
You would need to inject into the index using the gatheringnode method an extra field to indentify which site.
What you could do is inject into it a searchable path, currently by default you will have path field which is comma separated list of the full path and part of that path will have the root home page node id in there, so add new path field in there call it what you like but replace the , with a space. Update your query so that it filters on that path but pass in to the search macro your root home page id as I assume each site will have its own unique home page?
Filtering search to a single site
Is there any way get my search only to return results from a single site when I have multiple sites set up. I have a site copied for translation and it is picking up them.
var criteria = ExamineManager.Instance
.SearchProviderCollection[Index]
.CreateSearchCriteria();
var filter = criteria
.GroupedOr(new string[] { "nodeName", "bodyText","summary"},
searchTerm)
.Compile();
SearchResults = ExamineManager.Instance.SearchProviderCollection[Index]
.Search(filter);
Chris,
You would need to inject into the index using the gatheringnode method an extra field to indentify which site.
What you could do is inject into it a searchable path, currently by default you will have path field which is comma separated list of the full path and part of that path will have the root home page node id in there, so add new path field in there call it what you like but replace the , with a space. Update your query so that it filters on that path but pass in to the search macro your root home page id as I assume each site will have its own unique home page?
Regards
Ismail
is working on a reply...