lucene.net - Is there a special way to do faceting on numeric fields in Lucene? -


in application using lucene.net, have numeric field stores integers. cardinality of values rather low (typically less 20-30 different values).

i'd faceted search on field (using simplefacetedsearch contrib package), want numbers of hits per distinct value.

currently i'm storing copy of value as-is in additional text field , run faceted search on text field. returns correct results.

however, way go or there special way faceted search on numericfields?

note: because of low cardinality might consider setting precision-step int.maxvalue there's 1 term per value. suppose in case simple faceted search on numeric field , decode value manually using numericutils.prefixcodedtoint(). correct or there complications? tests far showed worked fine.

storing values facets in separate field sounds logical. numeric field can thought of modified value, string fields may have stemming , synonym expansion applied them. 1 field searching , 1 facets okay in these cases.

you calculate facets on mangled field (generated numericfield), , call prefixcodedtoint describe, , same result. reduce index size (no need store numeric value, or index separately). may reduce io load since can read values term index instead of seeking documents on hard drive, depends lot on index size, file system cache, etc.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -