python - Create term query on field contained in another field with elasticsearch-dsl-py -


i using elasticsearch-dsl-py , filter on term contained inside 1 this:

"slug": {     "foo": "foo-slug",     "bar": "bar-slug " } 

what :

search.query(‘filtered’, filter={"term": {"slug.foo": "foo-slug"}}) 

i prefer

search.filter(term, slug.foo="foo-slug") 

but can’t keyword can’t include dots.

if helps else, had same problem creating kind of query against child property not using nested objects. found solution use query method instead of filter method:

search.query('match', **{"slug.foo": "foo-slug"}) 

this worked me in elasticsearch 1.5.2.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

c# - System.FormatException' occurred in MongoDB.Bson.dll - XXX is not a valid 24 digit hex string -