0
votes

I'm having trouble searching for names that contain a comma. For example, searching 'John Smith' does not return 'Smith, John'.

My name field is indexed as a textfield, and my search query looks like this:

s = s.query("multi_match", query=query, type='phrase', phrase_slop=1, fields=['name', 'title'])

I added the phrase_slop=1 to successfully match names like 'John D Smith' when searching 'John Smith'. But how can I modify my query to match names with a comma?

1

1 Answers

0
votes

This is from elasticsearch reference. It might help. This kind of issue typically has to do with how the analyzer is set when creating the index. I recommend testing your index settings and queries in a console UI.