Elastic search dsl python analyze api

(Nikita) #1

How to make use of default _analyze in elastic search dsl python?

My query looks like below:

query = Q('regexp', field_name = "f04((?!z).)*")
search_obj = Search(using = conn, index = index_name, doc_type = type_name).query(query)
response = search_obj[0:count].execute()

Where do i put analyze() method so that i get to see how my "f04((?!z).)*" is getting broken into terms? Actually it seems like '!' doesn't work as regex. How do i change the anaylzer if default analyzer is unable to take '!' as regexp character?

I'm very new to use, finding little hard to accurately put analyze method in my code. PLease help.

Regexp character '!' doesnt work in ES dsl query even on type set as 'keyword' in mappings
(David Pilato) #2