Elasticsearch映射和搜索问题

时间:2018-07-12 17:00:27

标签: bash elasticsearch

请大家帮忙了解如何使用映射从Elasticsearch中搜索文档? 抱歉,我是新手,很抱歉,无法理解。 我在做什么:

curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d'
{
    "settings" : {
        "index" : {
            "number_of_shards" : 3, 
            "number_of_replicas" : 0
        }
    },
    "mappings" : {
        "game" : {
          "properties" : {
            "text" : {
              "type" : "string"
            }
          }
        }
    }
}'

输入三个测试元素:

curl -XPOST "http://localhost:9200/test/game/" -d '
{
    "text" : "game_name1",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}'

curl -XPOST "http://localhost:9200/test/game/" -d '
{
    "text" : "game_name2",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}'

curl -XPOST "http://localhost:9200/test/game/" -d '
{
    "text" : "game_name3",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}'

我想它运行良好,但是如何使用我所拥有的映射或者您可能会告诉重写它,我想获取诸如{"text":"game_name*"}{"text":"game_name3"}的记录

谢谢

0 个答案:

没有答案