2016-05-12 61 views
0

我剛剛創建停用詞分析器喜歡這樣禁用詞分析

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

彈性搜索這

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

,然後查詢它從搜索的是好的,但 刪除"an"關鍵字它顯示我所有的數據有詞俱樂部沒有泡吧 我必須找到所有數據有詞泡吧 onl y

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

查看event_place的值。 請幫我一把。謝謝

+0

我不明白什麼是要求。抱歉。您使用了粗體字母,並沒有提供任何示例文檔或期望的結果。 –

+0

我在那裏添加了我的結果....其顯示結果event_place與詞俱樂部不俱樂部 –

+0

'event_place'字段的映射是什麼? –

回答

2

"porter_stem"過濾器正在轉換您的clubbing搜索字詞club這就是爲什麼它匹配Asom Club Dwarka, Dwarka, New Delhi, India。刪除porter_stem過濾器,你應該很好去。

+0

感謝它的工作 –