How to match on prefix in Elasticsearch

前端 未结 5 662
太阳男子
太阳男子 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条回答
  •  猫巷女王i
    2020-12-30 03:09

    Have a look at prefix queries.

    $ curl -XGET 'http://localhost:9200/index/type/_search' -d '{
        "query" : {
            "prefix" : { "dots" : "first.second" }
        }
    }'
    

提交回复
热议问题