Saturday 13 May 2017

Optional asterisk in elasticsearch.

This is my _search options in query. When I'm typing wor it will match word but when I'm searching for word it's not matching. If i'm typing anything else it's matching again. For example expression is is this good when i type i it will match, is will not match and is t will match again. My analyzer have this fields

"tokenizer": "standard",
"filter": [
    "english_possessive_stemmer",
    "lowercase",
    "english_stop",
    "english_stemmer"
  ]

I tried both text* and text*? but they are not working.

'query_string': {
    'split_on_whitespace': false,
    'query': `${text}*?`,
    'fields': ['group_title^20', 'description', 'tags.name']
}

So the question : how I can match for whole expression instead of one word without changing analyzer, if there is no option then how i can setup it with analyzer.

Thanks in advance.



via Hovhannes Sanoyan

No comments:

Post a Comment