AnsweredAssumed Answered

Change analyzer in specific field in elasticsearch

Question asked by Diego Celdrán on Sep 28, 2018
Latest reply on Sep 28, 2018 by Diego Celdrán

Hi,

 

I have one custom field created in opportunities module. This field is an auto-calculated field and contains the account_id of the opportunity.

 

I want to filter for this field into elasticsearch, but if i use a query_string, elastic returns to me all the opportunities and if i use the term query, elastic returns nothing.

 

I am doing some research and i see if i use elasticsearch with one tag, the query generated is one term query with the id of tag, but doesn't works with a custom field i created.

 

I see the index metadata of elastic and i can see this:

 

my field:

 

"Opportunities__account_id_auto_c":{
      "index":false,
      "type":"keyword",
      "fields":{
         "gs_string":{
            "analyzer":"gs_analyzer_string",
            "store":true,
            "type":"text"
         },
         "gs_string_wildcard":{
            "search_analyzer":"gs_analyzer_string",
            "analyzer":"gs_analyzer_string_ngram",
            "store":true,
            "type":"text"
         }
      }
   }

The Tag field:

 

   "Common__tags":{
      "index":false,
      "type":"keyword",
      "fields":{
         "tags":{
            "type":"keyword"
         }
      }
   }

Can i add an analyzer to my custom field and can find a single id with this analyzer? Just like Sugar uses the tags search.

 

thanks!

Outcomes