Mapping template - how to disable analyze / keyword?


#1

Hi,
I need to store a message, which is bigger than 32k which is the max of lucene.

As I understand I need to create an index template and define the mapping for that field. And there I have to turn of the analyzer.

I exported the mapping of the field, here is the snippet:

"message_full_not_analyzed": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }

What do I need to change, to disable the analysis of this field?
Just deleting the fields object?

Thanks, Andreas


(Mark Harwood) #2

What do you want to be able to do with this field?

Right now the mapping you have provided treats it for two purposes:

  1. Search - the text type means it is analyzed so you can search for individual words in the message
  2. sorting/aggregating - the keyword is not analyzed so it can be treated as a single token in the index (if < 256 characters which avoids the 32k Lucene limit)

The correct mapping depends on what you want to do with the field's contents.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.