0

I searched using the endpoint:

http://url/sitecore/api/ssc/aggregate/content/Items?sc_apikey=D5471CCA-DB0D-4260-A588-3D15025BA5CF&$expand=FieldValues&$filter=contains(FieldValues/Summary,'test')

But this returned an exception:

 "error": {
        "code": "",
        "message": "An error has occurred.",
        "innererror": {
            "message": "Object reference not set to an instance of an object.",
            "type": "System.NullReferenceException",
            "stacktrace": "   at Sitecore.ContentSearch.SitecoreItemCrawler.IsExcludedFromIndex(SitecoreIndexableItem indexable, Boolean checkLocation)\r\n   at Sitecore.ContentSearch.SitecoreItemCrawler.GetContextIndexRanking(IIndexable indexable)\r\n   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\r\n   at System.Linq.Enumerable.Min(IEnumerable`1 source)\r\n   at Sitecore.ContentSearch.AbstractSearchIndex.Sitecore.ContentSearch.Pipelines.GetContextIndex.IContextIndexRankable.GetContextIndexRanking(IIndexable indexable)\r\n   at Sitecore.ContentSearch.Pipelines.GetContextIndex.FetchIndex.<>c__DisplayClass6_0.<RankContextIndexes>b__0(ISearchIndex i)\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\r\n   at 

Anyone else experienced this?

| improve this question | | | | |
  • Does your Sorl instance is running and available? – x3mxray 2 days ago
  • also, make sure no error in the rebuild index. – Mahendra Shekhawat 2 days ago
0

Exception is thrown in code:

public static IProviderSearchContext CreateSearchContext(IIndexable indexable)
{
  return GetIndex(indexable).CreateSearchContext(SearchSecurityOptions.EnableSecurityCheck);
}

Sitecore translates the IIndexable into a valid index for item. And then it creates a search context on that index.

The exception is thrown because the translation returns null (some item from your query doesn’t map to any index).

Make sure that itemservice search index is configured as “index all templates, except specific ones”, but NOT as “exclude all templates, except specific ones”.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.