1
0
mirror of https://github.com/apache/lucene.git synced 2025-03-04 23:39:38 +00:00

get lookupTerm working

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1433736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2013-01-15 23:30:45 +00:00
parent cadf8949e1
commit e1d294b8e1

@ -240,23 +240,22 @@ class Lucene41SimpleDocValuesProducer extends SimpleDVProducer {
throw new RuntimeException(bogus); throw new RuntimeException(bogus);
} }
} }
/* nocommit: WTF ant test -Dtestcase=TestSearchAfter -Dtests.method=testQueries -Dtests.seed=701751F140F42B9D -Dtests.slow=true -Dtests.locale=es_DO -Dtests.timezone=Asia/Sakhalin -Dtests.file.encoding=UTF-8
@Override @Override
public int lookupTerm(BytesRef key, BytesRef spare) { public int lookupTerm(BytesRef key, BytesRef spare) {
try { try {
InputOutput<Long> o = fstEnum.seekCeil(key); InputOutput<Long> o = fstEnum.seekCeil(key);
if (o == null) { if (o == null) {
return -getValueCount()-1; return -getValueCount()-1;
} else if (o.input.equals(Util.toIntsRef(spare, scratchInts))) { } else if (o.input.equals(key)) {
return 0; return o.output.intValue();
} else { } else {
return (int)-o.output-1; return (int) -o.output-1;
} }
} catch (IOException bogus) { } catch (IOException bogus) {
throw new RuntimeException(bogus); throw new RuntimeException(bogus);
} }
} }
*/
@Override @Override
public int getValueCount() { public int getValueCount() {