I am running Sitecore 9 update 2 on Azure Web App, with Azure Search. I am trying to use the Sitecore Facet Support, that works completely fine with Solr, but having no luck at all with Azure.

So my scenario is I am trying to build filters on the search results page and based on the Sitecore documentation

enter image description here

My code (fine with Solr) looks like this:

    queryable = queryable.FacetOn(item => item[facet.FieldName]);

So facet.FieldName would in my case be "content_type" that I would be expecting Azure to return my a list of Categories for the filters.

So I am expecting (again fine with Solr) to allow me to follow up with something like this:

        foreach (var category in queryable.GetFacets().Categories)

But the Facet Categories just don't get set. There's no errors in the logs, and doesn't effect the Search results. Based on what I have read and understood here this should be working the same across the two different search providers.

enter image description here

  • Can you check the search logs? They should log the actual request. Compare the solr and azure version in those logs.. – Gatogordo Mar 26 at 17:17
  • 1
    I can see in the the Search logs that the Solr version has facet info in the Query where as the Azure one doesn't have anything. The parameter &facet=true in the Solr one which could be the difference, but problem is how do explicitly say to add that in the Azure query or do I need to? – Lee Swainsbury Mar 26 at 17:31

Your Answer

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

Browse other questions tagged or ask your own question.