Message Boards

Custom Mapping for Elasticsearch in Liferay

Daniel Kęska, modified 4 Years ago.

Custom Mapping for Elasticsearch in Liferay

New Member Posts: 12 Join Date: 4/25/19 Recent Posts
In Elasticsearch I wanted to index some fields with my custom analyzer. So first, I added to additional configurations my analyzer:{
    "analysis":{
      "analyzer": {
        "my_analyzer": { 
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "polish_stem",
"asciifolding",
            "pl_stop"
          ]
        }
      }
}, then I added full new mapping ( to Override type mappings),  for example:"title": {
"type": "text","boost": 9500,"store": true,"term_vector": "with_positions_offsets","analyzer": "my_analyzer"},I deleted index, restarted Liferay. Portal created a new index with my mapping and my analyzer correctly. Then I reindexed my docs.And when I search sth in Elasticsearch it shows expected results, I see that it analyzed my fields as I wanted. But when I search through Liferay portal I see no change, my field is not analyzed. What I am doing wrong? I have the new index and data comes from it so why Liferay does not see it? 

PS: I tried to add nested field to the main field and set them different mapping, but Liferay didn't wart to search with nested field ex. "title.analyzed_field".
Thank's for any suggestions!