solr icon indicating copy to clipboard operation
solr copied to clipboard

SOLR-12074: Add optional terms index for PointFields

Open HoustonPutman opened this issue 1 month ago • 1 comments

https://issues.apache.org/jira/browse/SOLR-12074

This is to replace the only functionality that TrieFields outperform PointFields in, namely term or termInSet matching.

Currently this uses the enhancedIndex option, but we should find a better name.

Other side issues, like expanding pointField functionality when this is enabled, will be done afterwards.

HoustonPutman avatar Dec 04 '25 21:12 HoustonPutman

Ok, benchmarking with and without docvalues, enhancedIndex and Point vs Trie:

Benchmark                        Mode  Cnt     Score      Error  Units
NumericSearch.intDvEnhancedSet  thrpt    5  4495.128 ±  867.927  ops/s
NumericSearch.intDvSet          thrpt    5  2858.541 ±  594.706  ops/s
NumericSearch.intEnhancedSet    thrpt    5  4638.795 ±  568.743  ops/s
NumericSearch.intSet            thrpt    5  1191.282 ±  107.378  ops/s
NumericSearch.intTrieDvSet      thrpt    5  4845.332 ±  252.985  ops/s
NumericSearch.intTrieSet        thrpt    5  4495.456 ± 1568.532  ops/s

The same benchmark on main (No change to the queries):

Benchmark                    Mode  Cnt     Score     Error  Units
NumericSearch.intDvSet      thrpt    5  3298.151 ± 482.841  ops/s
NumericSearch.intSet        thrpt    5  1295.497 ±  44.262  ops/s
NumericSearch.intTrieDvSet  thrpt    5  4727.185 ± 357.855  ops/s
NumericSearch.intTrieSet    thrpt    5  4748.940 ± 667.751  ops/s

Looks like we are good to move forward with this and remove TrieFields.

HoustonPutman avatar Dec 04 '25 22:12 HoustonPutman

I think "enhancedIndex" is a terrible name; sorry.

Agreed, it was only a placeholder.

I've created a new PR to change this to a new fieldType that can have it enabled by default (which we can't really do currently since existing fields don't have the index). https://github.com/apache/solr/pull/3972 I think that's the direction I want to go, then deprecate and remove all other numeric fields.

HoustonPutman avatar Dec 20 '25 00:12 HoustonPutman