簡體   English   中英

Elasticsearch中用於映射的分析器多詞,多字段搜索

[英]Analyzer For Mapping in Elasticsearch multi-word, multi-field search

我想在多個字段中使用yii2-elasticsearch進行全文搜索,其中所有字段都使用指定的分析器在文檔中進行了檢查。

所以,如果我有一個映射:

"settings": {
        "analysis": {
          "analyzer": {
            "lowercase_keyword": {
              "tokenizer": "keyword",
              "filter":  [ "lowercase"]
            }
          }
        }
      },
     "mappings" : {
        "typeName" :{     
          "properties" : {
            "id" : {
              "type" : "string",
              "index" : "not_analyzed"
            }, 
            "company_name" : {
              "type" : "string",
              "index" : "analyzed",
              "analyzer" : "lowercase_keyword",  
            },
            "product_name" : {
              "type" : "string",
              "index" : "analyzed",
              "analyzer" : "lowercase_keyword",  
            },
            "product_desc" : {
              "type" : "string",
              "index" : "not_analyzed"
            },     
          }
        }
      }
    } 

我想在company_name,product_name,product_desc中搜索一個單詞。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM