Hi there

How to combine a nested query with a spatial filter in Apache Solr? This
is a simplified nested query which should be combined with a spatial filter:

curl "http://localhost:8983/solr/corename/query"; -d '{
  "query":{
    "bool":{
      "must":[
        "type:product",
        "product.siteid:(1.)",
      ]
    }
  }
}'

It doesn't work this way:

curl "http://localhost:8983/solr/corename/query"; -d '{
  "query":{
    "bool":{
      "must":[
        "type:product",
        "product.siteid:(1.)",
        {
          "filter":"{!bbox sfield=index.supplierloc}",
          "pt":"52.5,10",
          "d":"115"
        }
      ]
    }
  }
}'

What's the correct query syntax to combine spatial filters with nested
queries?

Note: The original query is more complex and the filter can't be at the
same level as "query" because it needs to be part of one "must" query
conditions but must not be applied to another condition.

Cheers
Tom

Reply via email to