RE: Adding two analyzers to additional index configurations - elasticsearch

P G, modified 6 Years ago. New Member Posts: 21 Join Date: 2/15/17 Recent Posts
Hi all,

I need to set new analyzers for elasticsearch using the control panel. 
To achieve my aim I go to: Control Panel > Fondation > Elasticsearch. 

Then I add the following configuration:

Additional Index Configurations:
{  
    "analysis": [
        {
            "analyzer": {
                "documentum_analyzer": {
                    "filter": [
                        "lowercase"
                     ],
                    "tokenizer": "documentum_tokenizer"
                }
            },
            "tokenizer" : {
                "documentum_tokenizer" : {
                    "type": "edge_ngram",
                    "min_gram": 2,
                    "max_gram": 10,
                    "token_chars": [
                        "letter",
                        "digit",
                        "punctuation"
                    ]
               }
            }        
        },
        {
            "analyzer": {
                "custom_rubrica_analyzer": {
                    "filter": [
                        "lowercase"
                     ],
                    "tokenizer": "custom_rubrica_tokenizer"
                }
            },
            "tokenizer" : {
            "custom_rubrica_tokenizer" : {
            "type": "edge_ngram",
                    "min_gram": 1,
                    "max_gram": 10,
                    "token_chars": [
                        "letter",
                        "punctuation"
                    ]
               }
            }        
        }
    ]                
}

When I add just one analyzer, it works very good, I have all my custom elements. With two analyzers my custom items are not present into the index.
How can I add two or more analyzers in the Additional Index Configurations?
Vishnu S Kumar, modified 6 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
The problem is with the JSON structure. Please look at the following JSON with 2 analysers.
​​​​​​​{  
   "analysis":{  
      "analyzer":{  
         "analyser1":{  
            "type":"custom",
            "tokenizer":"standard",
            "char_filter":[  
               "html_strip"
            ],
            "filter":[  
               "asciifolding",
               "lowercase",
               "typeahead_filter"
            ]
         },
         "analyser2":{  
            "type":"custom",
            "tokenizer":"standard",
            "char_filter":[  
               "html_strip"
            ],
            "filter":[  
               "asciifolding",
               "lowercase"
            ]
         }
      }
   }
}
I hope this will fix your issue. Please let me know the status
P G, modified 6 Years ago. New Member Posts: 21 Join Date: 2/15/17 Recent Posts

Hi and sorry for the late.

Thanks for you example. It works properly.

 

Paolo.