prepare more efficient query completion

adding an index that answers the question
given a query "a=b and c=", what are possible values
for c.
This commit is contained in:
2019-01-13 10:22:17 +01:00
parent 5197063ae3
commit 72e9a9ebe3
8 changed files with 338 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import java.util.TreeSet;
import java.util.function.BiConsumer;
import java.util.function.Function;
import org.lucares.collections.IntList;
import org.lucares.collections.LongList;
import org.lucares.utils.byteencoder.VariableByteEncoder;
@@ -156,6 +157,14 @@ public class Tags implements Comparable<Tags> {
return result;
}
public IntList getKeysAsInt() {
final IntList result = new IntList();
for (final Tag tag : tags) {
result.add(tag.getKey());
}
return result;
}
public List<Tag> toTags() {
return Collections.unmodifiableList(tags);
}