pandasticsearch icon indicating copy to clipboard operation
pandasticsearch copied to clipboard

Support for nested field names

Open lifeofzero opened this issue 7 years ago • 5 comments

Really great project! One thing I was curious about is supported nested field names. For example:

foo.bar foo.baz foo.zap

Our schema in Elasticsearch supports one-level nesting, and I was having hard time getting the following to work.

df.filter(df.foo.bar == 'jane').select('last_name', 'email','age').collect()

Any help or suggestions would be appreciated. If was searching directly against the ES REST API the filter looks like:

"query": { "filtered": { "query": { "query_string": { "query": "+foo.bar:jane", "analyze_wildcard": true, "lowercase_expanded_terms": false } }

lifeofzero avatar Jul 11 '17 03:07 lifeofzero

I'm Sorry. The nested field is not on the roadmap currently. But It is a good idea if we could utilize the query_string of ES to implement such feature.

onesuper avatar Jul 11 '17 09:07 onesuper

+1

flexthink avatar Jan 31 '18 14:01 flexthink

+1 would help a lot

gsemet avatar Oct 12 '18 14:10 gsemet

We might use script filter instead as a workaround.

onesuper avatar Nov 13 '20 04:11 onesuper

Hi thanks for this cool library ! does this issue include nested queries as such :

{'query':{
          'nested': {
                    'path': 'docs',  'query': {
                                              'match': {
                                                      'docs.feature': 'search_term'
                                                       }
                                            }
                         }
            }
}

?

LuisBlanche avatar Dec 08 '20 15:12 LuisBlanche