Domanda

I have a customized search web-part developed for SP2010 wich according to the source code is using Scopes in its query-string. The whole SP environment is now migrated to SP2013, and Scopes are no longer af part of 2010. Because of this change, the web-part does not longer display any search results.

Which solution is needed here? My tought was to create result sources in 2013, containing all the appropriate site-collections, and then change the source-code, the query string til hit the result source instead of the scope. Is this the correct way to do it?

enter image description here

So this is how the web-part looks like.

  • The text field is a regulra search field
  • Zip code is a managed property
  • Town is a managed property
  • And there are some more managed properties

The query string in the url-field ends with "...myPageWithWebPart.aspx?k=sharepoint?s=myScope"

So the data is not returned because the query-string is set to look after scope with name MyScope. So any idea how to change this to be working with 2013.

È stato utile?

Soluzione

Use the SourceId parameter instead of the "s" parameter.

http://server/_api/search/query?querytext='sharepoint'&sourceid='8413cd39-2156-4e00-b54d-11efd9abdb89'

You can get more info here: https://msdn.microsoft.com/en-us/library/office/jj163876.aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top