1

I'm trying to figure out how to make and indexed field (City) play nice with fulltext search exposed filter and a facet term.

As of right now, a fulltext option works with the search bar, but splits 2 word cities into separate facets. And string combines multi-word cities into one facet, but then breaks the search bar.

What setting will work for both?

1 Answer 1

1

I had an issue similar to this with 2 separate fields, Country and City. Country was a taxonomy term while City was a textfield. I wanted to use both for fulltext search and as facets. In my Search API Index I added related fields for my Taxonomy (Country) and used the name (Country:name) as a fulltext field for my search bar. The thing is that the City when indexed as a fulltext didn't work in combination with the Country facet, and when I changed it to string it didn't work with the search bar.

Solution:

  • Leave your field (City) as a string field
  • Go to your Search API Index
  • Click on "Filters"
  • Check "Aggregated Fields"
  • Add new field and select your desired field, for example "City" and aggregation type "fulltext"
  • Go to your view, where you use the fulltext search, click on it and in the Searched fields you will see the aggregated field you had added before.

It should work fine now. If not, try re-indexing the items, clear your cache, double check that the field is set to be indexed, etc.

1

Your Answer

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

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