How to get a list of Search Result Sources using PowerShell?

Hi,

Is there a way I can use PowerShell to get a full list of Search Result Sources in the SharePoint farm, including farm, site collection, and web level result sources?

Thank you.

August 20th, 2015 7:25pm

Hi,

We can use the SourceId property in the KeywordQuery object to set which Result Source, and use the Query Transform to narrow search results.

http://blog.mastykarz.nl/programmatically-working-keyword-search-queries-sharepoint-2013/

https://technet.microsoft.com/en-us/library/Dn186229.aspx#BKMK_How_does_query_transform_affect_query

You can also use Search REST API to get the lists, here is a tool for your reference:

https://sp2013searchtool.codeplex.com/

Best Regards,

Dennis Guo

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 10:41pm

Thank you Dennis.

But I'm not trying to perform search using a result source. Rather I'm trying to get a list of result sources that's already in the system.

In Search Administration in Central Admin, when you run a Usage Report for Top Queries By Month, the report shows all the query text against the result source it was run against, even if the result source was created for a site collection or site.

Having a farm of tons of site collections, and God know who has created result sources in some site collections, is there a command I can run either in PowerShell or C# that will just give me the full list of result sources and where they were created?

Thank you for your help.

Kind regards 


August 24th, 2015 12:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics