0

I want to use yii2-elasticsearch for fulltext search with in multiple fields, where all the fields are checked in a document with the assigned analyzers.

So if I have a mapping:

"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"
            },     
          }
        }
      }
    } 

I want to search a word in company_name,product_name,product_desc.

Jyoti Garg
  • 93
  • 3
  • 9

1 Answers1

0

Check out this two links that might be helpful to resolve your issue.

Filename search with ElasticSearch

http://jontai.me/blog/2013/02/adding-autocomplete-to-an-elasticsearch-search-application/

Community
  • 1
  • 1
vijay nathji
  • 1,608
  • 13
  • 23