Long keyword/text fields just for retrieval


#1

Hi,

I need to store long fields, which I won't use for searching, sorting or aggregation. Which type should I use?

Keyword makes me think of short values like 'id', 'login', 'type'...

But I don't need to analyze/tokenize the field, I just want to put it in the elasticsearch and get it back.

Should I use keyword... maybe with some options like "doc_values": false?

Or text with "index": false?

Which would be more performant or anyhow more proper?


(Colin Goodheart-Smithe) #2

For this I would use a keyword field with "index": false and "doc_values": false


#3

There is a problem with field length..

Document contains at least one immense term in field=\\\"value\\\" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped
(...)
bytes can be at most 32766 in length


(Colin Goodheart-Smithe) #4

This suggest that the "index":false setting was not applied. Can you check the mapping for that field and ensure that both "index":false and "doc_values: false are applied (you can do this by doing GET <INDEX_NAME>/_mapping) ?


#5

Thank you for quick answer. Turns out my script didn't add "index": false to the mapping.

Big thanks again!


(Colin Goodheart-Smithe) #6

No Problem, glad you got it working :slight_smile:


(system) #7

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