Possible Filter matches

Hi, I want to create a text search along with some filter checkboxes. In the past, I worked with Meilisearch, and they had a nice feature which I am looking for in Weaviate.

It is to return for my filters a number with the possible matches. For example, look at the picture where it says how many hits this filter has. This would make the filter search very wonderful because the filter with the most hits would always be first.

Is there a way to do this in Weaviate?
Screenshot_2024-03-30_11-15-22

Hi! This is possible!

here is some code for reference:

from weaviate import classes as wvc

include_weather = True
include_plane = True

base_filter = wvc.query.Filter.by_property("category").equal("ANIMALS")

if include_plane:
    base_filter = base_filter | wvc.query.Filter.by_property("question").like("plane")
if include_weather:
    base_filter = base_filter & wvc.query.Filter.by_property("question").like("feature")

query = questions.query.fetch_objects(
    filters=base_filter
)

this considering you are using python :slight_smile:

Also note that you can use & or | depending on your logic.

Let me know if this helps :slight_smile: