简体   繁体   English

Elastic Search中的停用词分析器

[英]stopword analyser in Elastic Search

I just created a stopword analyser like this 我刚刚创建了这样的停用词分析器

{
"settings": {
"analysis": {
  "filter": {
    "english_stopwords": {
      "type": "stop",
      "stopwords": "_english_"
    }
  },
  "analyzer": {
    "filter_english_stopwords": {
      "type": "custom",
      "tokenizer": "standard",
      "filter": [
        "english_stopwords",
        "porter_stem"
      ]
    }
  }
}}}

and then query in elastic search like this 然后像这样在弹性搜索中查询

{
"query": {
"filtered": {
  "query": {
    "multi_match": {
      "query": "an clubbing",
      "fields": [
        "event_name",
        "event_place",
        "event_description"
      ],
      "analyzer": [
        "filter_english_stopwords"
      ]
    }
  }
}}}

it removes the "an" keyword from search which is fine but it shows me all data having word club not clubbing I have to find all data having word clubbing only 它从搜索中删除了"an"关键字,这很好,但是它向我显示了所有具有单词club的数据, 我只能找到所有具有word clubbing的数据。

        "_source": {
            "event_id": "1669",
            "event_name": "Exclusive Ladies Night Party",
            "regular_id": "56750ee601fcfffc058b4567",
            "event_place": "Asom Club Dwarka, Dwarka, New Delhi, India",

See event_place value. 请参阅event_place值。 Please help me out. 请帮帮我。 Thanks 谢谢

"porter_stem" filter is transforming your clubbing search word in club and this is why it's matching Asom Club Dwarka, Dwarka, New Delhi, India . "porter_stem"过滤器正在转换club clubbing搜索词,这就是为什么它与Asom Club Dwarka, Dwarka, New Delhi, IndiaAsom Club Dwarka, Dwarka, New Delhi, India匹配的原因。 Remove the porter_stem filter and you should be good to go. 删除porter_stem过滤器,您应该porter_stem顺利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM