9

Currently, I'm using facet to filter the search result. The result works perfectly fine with SOLR but when I switch to Azure it doesn't work anymore. The result shows all although I added filter criteria. While troubleshooting this by debugging, I found that the virtual field content_type is missing from Cloud Field Name Map, then I assume that the virtual field cannot generate in Azure Search or I missed some configuration with it. I hope to receive feedback from you guys. Thank you very much.

Ps: I think the issue comes from item [facet.FieldName]. This field cannot be generated when queryable is executed.

Below is the source code for filtering by facet enter image description here

My facet is defined in Sitecore content as below enter image description here

and this is its configuration enter image description here

and Cloudfieldmap cannot find virtual field content_type enter image description here

5
  • For the first part, did you try 'Filter' instead of 'Where'?
    – TamerM
    Dec 26, 2017 at 15:58
  • 1
    The line facetValuePredicate should be PredicateBuilder.False<ISearchResultItem>(); It is True for And() and False for Or().
    – Chris Auer
    Dec 27, 2017 at 2:05
  • Hi Tamer, I try 'Filter' instead of 'Where' but the result is the same. Hi Chris, I also try your approach but it's also the same Dec 28, 2017 at 3:53
  • Well you're going to have to do some debugging: try removing all predicates and just add one where statement predicate on this field
    – TamerM
    Dec 28, 2017 at 6:56
  • Azure Cognitive Search will be discontinued in the future and Sitecore will no longer provide support for this service in future releases. doc.sitecore.com/xp/en/developers/92/…. Feb 19, 2023 at 9:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.