Unexpected result using Elasticsearch when dash character is involved

56 Views Asked by At

I'm querying Elasticsearch 2.3 using django-haystack, and the query that is executed seems to be the following:

'imaging_telescopes:(*\\"FS\\-60\\"*)'

An object in my Elasticsearch data has the following value for its property imaging_telescopes: "Takahashi FSQ-106N".

This object matches the query, and to me this result is unepected, I wouldn't want it to match.

My assumption is that it matches becasue it contains the letters FS, but in my frontend I'm just searching for "FS-60".

How can I modify the query so that it's stricter in looking for objects whose property imaging_telescopes exactly contains some text?

Thanks!

EDIT: this is the mapping of the field:

"imaging_telescopes": {
  "type": "string",
  "analyzer": "snowball"
}
0

There are 0 best solutions below