Closed synweap15 closed 7 years ago
Figured it out - obviously I made a mistake taking some assumptions concerning Lucene syntax for nested fields. Did some reading and the query should be formulated as follows: study_units:(country:(name:italy))
- works like a charm!
You could write the query like this study_units:country:name:italy
too :)
Right, thanks @ahivert!
Another question: I have defined a few fields as Object
types instead of Nested
using elasticsearch-dsl, so they can be searched without explicitly specifying fields. The problem is that when I search using eg. country.name:Italy
(not nested, just flattened, looks correct in Kibana), it's still treated as nested by Luqum - and then depending whether it was defined in nested_fields
or not, I get RequestError for Elasticsearch or NestedSearchFieldException from _recurse_nested_fields
.
Any hints?
Hi @synweap15, indeed we did not have Object
in mind when we decide to deal with nested field. Could you file a new ticket, possibly with expected behaviour ?
For now I close this ticket.
Sure, I'll open a new issue. Thanks!
Hello!
First of all I'd like to thank the authors of this amazing library for all the effort - this library really helps when it comes to querying nested fields with ES' Query String Query.
I've found some issue concerning the parser when it comes to parsing multi-level nested fields (nested fields within nested fields).
Here's my definition of
ElasticsearchQueryBuilder
:The query looks like this:
study_units.country.name:italy
The produced output looks like this:
I think that the most outer
path
key should have the value ofstudy_units
instead ofname
.My question - is this a problem with my definition of nested fields, or something is off here?