1

I have indexed some string in this index:

{
  "mappings": {
     "record" : {
           "properties" : {
               "my_suggest" : {
                   "type":"completion" 
                }
            }
      }
  }
}

In my index there are these values:

  1. my_suggest = foo1
  2. my_suggest = bar
  3. my_suggest = something2

If I query:

   {
    "query":{
        "wildcard":{"my_suggest":"*foo*"}
        }
    }

I have returned the record number 1.

If I do this query:

   {
    "query":{
        "wildcard":{"my_suggest":"*foo1*"}
        }
    }

I have returned blank results. I am expecting the record number one.

Why this happens?

Thanks.

1 Answer 1

2

Elasticsearch uses simple analyser by default, which removes any non letter characters.

https://www.elastic.co/guide/en/elasticsearch/reference/5.5/analysis-simple-analyzer.html

Please use another type of analyser or custom analyser as per your requirements.

https://www.elastic.co/guide/en/elasticsearch/reference/5.5/analysis-analyzers.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.