8

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

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

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

My facet is defined in SC 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

  • For the first part, did you try 'Filter' instead of 'Where'? – TamerM Dec 26 '17 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 '17 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 – user1979636 Dec 28 '17 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 '17 at 6:56

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.