apache / apache/lucene

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

Open
#5,628 1 comment 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor module:core/FSTs type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

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](https://issues.apache.org/jira/browse/LUCENE-4562) by David Smiley (@dsmiley), updated Nov 19 2012
Linked issues:
- #4803

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing FST utility APIs, especially Util.getByOutput, and the sorting-across-segments work in linked issue #4803. The change is complete when a utility compares entries from two FSTs by their ords and returns -1, 0, or 1 with the same ordering as comparing the corresponding byte-array keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.