We're experimenting with Facets and Search API under Drupal 8. We are trying to filter Bars and Hotels by Location (country, city) and by Amenities (diner, pool, etc.).

Our test output page has the list of facet results on the left, and the two facets for the Location and Amenities on the right.

The Facet "Location" output would look something like this:
+Country (2)
- City A (6)
- City B (3)

So, City A has six Bars and City B has 3. I would therefor expect Country to show a count of 9, the total amount of Bars in all cities. Instead it shows a count of two, the amount of cities in the country. Facet "Amenities" output has the same issue. Reading through the comments of the older "Facet API" module people indicate it has to do with the count reported back from the query by Search API. Some suggested trying Apache Solr as back-end, or Elasticsearch. But those seem utter overkill for our needs.

Also, once you select City A you can also still select City B, thus listing Bars in both locations, which is an undesired situation. As in, a user should be able to choose either City A or City B but not both.

The facets for Location and Amenities seem to interact, but not how we expect. When you select a City it shows a list of Amenities. Good, so far. However, when you also select an Amenity, the list of search results is empty.

Related: we would like display the Bars listed in the Facet search results on a map on the same page. The map should be updated as the search results change. We have integrated Geofield to store the langitude and longitude.

Any tips on how to proceed?

Related links:
https://www.drupal.org/project/search_api
https://www.drupal.org/project/facets
https://www.drupal.org/project/geofield

Comments

vaccinemedia’s picture

I am using the address field and adding a facet for any of the address fields crashes the config screen for that facet....

I'm a Drupal Website Developer and Google Street View Trusted Photographer.