django-elasticsearch-dsl-drf icon indicating copy to clipboard operation
django-elasticsearch-dsl-drf copied to clipboard

location filtering and include ?

Open akhan118 opened this issue 3 years ago • 3 comments

Hi,

is it possible to get all publishers within the specific geo distance like below AND also return publishers who are not in that radius and have the name=john?

http://localhost:8000/search/publishers/?location__geo_distance=100000km__12.04__-63.93

also, is minimum_should_match available?

akhan118 avatar Feb 08 '22 01:02 akhan118

@akhan118:

You will need to write a custom backend for that.

barseghyanartur avatar Feb 08 '22 08:02 barseghyanartur

thank you, is there an example of how to write one? I'll give a try

akhan118 avatar Feb 08 '22 15:02 akhan118

You could take a look at any existing backends.

For instance, for something that is hard to generalise, something like this could be written.

barseghyanartur avatar Feb 08 '22 15:02 barseghyanartur