Defining analyzer while querying in elasticSearch

后端 未结 3 1907
眼角桃花
眼角桃花 2021-01-31 03:25

I am pretty new to elasticsearch and just need some clarification: Can we define a analyzer while querying the search server. I tried it with the \"text\" and \"field\" query an

3条回答
  •  野性不改
    2021-01-31 03:37

    This syntax worked for me:

    GET /_search
    {
      "query": {
        "match_phrase": {
          "controller": {
            "analyzer": "keyword",
            "query": "api/v2/test"
          }
        }
      }
    }
    

    Find more details in the documentation.

提交回复
热议问题