How do i make a range query/filter for a nested field using DSL?
See original GitHub issueTried:
query = query.filter('range', **{'field.name': {'lt': 1.22}})
always comes up with empty results
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Doing a Range Query over particular Nested Document
Is it possible to get only the document that has title: duration and their value is greater than 60.Value Property in the nested...
Read more >Nested query | Elasticsearch Guide [8.5]
Wraps another query to search nested fields. The nested query searches nested field objects as if they were indexed as separate documents.
Read more >Search DSL — Elasticsearch DSL 7.2.0 documentation
To make it easier, the Q shortcut (as well as the query , filter , and exclude methods on Search class) allows you...
Read more >Deep Dive into Querying Elasticsearch. Filter vs Query. Full ...
The range query also works well with dates. Regexp, wildcard and prefix queries. Regexp query returns the documents in which fields match your ......
Read more >Boolean queries - OpenSearch documentation
If you have multiple queries, all of them must match. ... Use the filter query to filter the results based on exact matches,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For nested fields you need to use nested filters:
Note also that you can use double underscore instead of
.
to avoid having to use the**{}
construct.Hope this helps.
@siddhism you can either use python’s
**
expansion (query.filter('match', **{"fs.mount_point": "/"})
) or use the fact thatelasticsearch-dsl
will expand__
to dot:query.filter('match', fs__mount_point='/')