M
M
magary42016-12-01 19:22:05
Database
magary4, 2016-12-01 19:22:05

Can't write a query with 2 facets?

In the database, each document has a city field and a country field,
I make a request facet.field=city&facet=on
and get

"facet_counts":{
    "facet_queries":{},
    "facet_fields":{
      "property__city__string":[
        "Chennai",2,
        "Riyadh",2,
        "Bogota",1,
        "Bucharest",1,
        "Chambery",1,
        "Dax",1,

but I also need to group it by country
in order to know which city belongs to which country,
I don’t need faceted search here,
I just asked Google how to make distinct and found such a solution

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question