Question

I am working on a SP2013 farm. The farm have 1 web application and 3 site collections A, B, C. My requirement is setup a search box in each of them and limit the search results within the site collection only.

i.e. Users search in site collection A will never get result from B and C.

I see there are two way to achieve it:

  1. Setup 3 content sources for each site collection
  2. Setup 1 content source for the web application (covered A,B and C). Then in each site collection setup a result sources with a search query like "Path:{SiteCollection.URL}" to limit the search result returned.

May I know which method is better? Would you mind share your experience and list the pros and cons? Thanks.

Was it helpful?

Solution

I can't think of a major reason to go with one way or the other from a query standpoint except maybe convencience:

  • ContentSource
    • contentsource:fileserver
  • ResultSource
    • is a property on your KQL object and needs a guid
    • keywordQuery.SourceId = resultSourceId;

Also, content sources can be crawled seperately, if you want that level of granularity.

Maybe there's implications at the Query results level ? I know you have different pages for different result sources (For only showing people etc).

In our current project we have result sources but the results are different entities in this cases (seperate result source for each entity). If it's just a location difference maybe seperate content sources make more sense.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top