How to match on prefix in Elasticsearch

前端 未结 5 666
太阳男子
太阳男子 2020-12-30 02:49

let\'s say that in my elasticsearch index I have a field called \"dots\" which will contain a string of punctuation separated words (e.g. \"first.second.third\").

I

5条回答
  •  情深已故
    2020-12-30 03:09

    You should use a commodin chars to make your query, something like this:

    $ curl -XGET http://localhost:9200/myapp/index -d '{
        "dots": "first.second*"
    }'
    

    more examples about the syntax at: http://lucene.apache.org/core/old_versioned_docs/versions/2_9_1/queryparsersyntax.html

提交回复
热议问题