apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.67k stars 1.03k forks source link

Pair-wise FST key comparator by ords [LUCENE-4562] #5628

Open asfimport opened 11 years ago

asfimport commented 11 years ago

It would be useful to have an FST utility method to do a compare() operation between a key in one FST and a key in a second FST, by ords instead of the keys. So the input is the ord for FST1 and an ord for FST2 and the output is -1, 0, 1. The result is the same as if you were to do a Util.getByOutput for both ords against their respective FSTs then compare the resulting byte arrays.

The point of this is to speedup #4803 further, which impact sorting across segments. I would be surprised if it doesn't have applicability to other problems.


Migrated from LUCENE-4562 by David Smiley (@dsmiley), updated Nov 19 2012 Linked issues:

asfimport commented 11 years ago

Michael McCandless (@mikemccand) (migrated from JIRA)

That's a cool idea! In the patch in #4803 I just do the full lookup and then compare ... but making it incremental (this issue) is a great idea.