How I partially filter in tab discover

Hello everyone,

I've a text type field and i want to partially filter in this field:

My index:

put test
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer" : "standard",
"stopwords":["spanish","english","catalan"],
"filter":["standard", "asciifolding","stemmer"]

    }
    }
}

},
"mappings" : {
"test" : {
"properties" : {
"field":{"type":"text","analyzer":"my_analyzer"}
}
}
}
}

The field contain threeJSON:

put test/test/1
{
"field":"Hello"
}

put test/test/2
{
"field":"World"
}

put test/test/3
{
"field":"Hello John"
}

How I can filter the 'filed' contain 'he' and kiba return the information of the first and third JSON?

PD: Version ElastiSearch: 5.4

Thanks.

Looks like you just need to use a wildcard.

Try:

GET test/test/_search
{
  "query": {
    "query_string": {
      "query": "He*"
    }
  }
}

Wildcard is perfect.

Thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.