BlackPOP
BlackPOP

Reputation: 5747

Use of "precision_step" in elasticsearch mappings

In elastic search mapping there is an optional field called precision_step. What it means . I searched in google . i cant find any solid info about.

Can anyone please explain what is a precision_step and use of it..!

thanks in advance..!

Upvotes: 4

Views: 1600

Answers (2)

Dinesh Kumar P
Dinesh Kumar P

Reputation: 1178

Suitable values are between 1 and 8. A good starting point to test is 4, which is the default value for all Numeric* classes.

Actual usage is, Lower values consume more disk space but speed up searching. Lower step values mean more precision and so more terms in index (and index gets larger).

Upvotes: 2

mconlin
mconlin

Reputation: 8753

It is part of the mapping for dates and numbers.

It is a Lucene concept, you can read more here: Lucene doco

From the Lucene Doco:

Good values for precisionStep are depending on usage and data type:

  • The default for all data types is 4, which is used, when no precisionStep is given.

  • Ideal value in most cases for 64 bit data types (long, double) is 6 or 8.

  • Ideal value in most cases for 32 bit data types (int, float) is 4.

  • For low cardinality fields larger precision steps are good. If the cardinality is < 100, it is fair to use Integer.MAX_VALUE (see below).

Upvotes: 4

Related Questions