Optimized keyword fields that only have integers

Hi,

Does lucene / es optimize (or is there a way to config) keyword fields that are guaranteed to have only numbers and only need equality filtering (for inverted-index, doc-values, term dictionary etc) ?

I remember _id has this optimization, so the number isn't stored as a string(number).

Meaning, if it stores them as strings, then it would be better to store as base64 or something similar to reduce the string size, right ?

Regards,
ddorian43

ddorian43,

Please see [1] for information on mapping numeric fields.
Note in particular the coerce parameter.

Regards,
Glen

Hi Glen,

I understand coerce but this has nothing to do with what I asked. I was interested in low level optimization, something like https://github.com/elastic/elasticsearch/issues/25957 but for fields and not just the _id.

2 weeks later bump.

Last bump.

Pinging @jpountz in case he can provide an answer.

Maybe create a custom normalizer that uses a Base64 encoding for the keyword?

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