mirror of https://github.com/apache/lucene.git
resolve todo, use Term(String field, BytesRef bytes) ctor
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1052915 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
42f25e65e0
commit
21db53c2a4
|
@ -23,7 +23,6 @@ import org.apache.lucene.search.Searcher;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.solr.search.MutableValueInt;
|
import org.apache.solr.search.MutableValueInt;
|
||||||
import org.apache.solr.search.MutableValue;
|
import org.apache.solr.search.MutableValue;
|
||||||
import org.apache.solr.util.ByteUtils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -242,9 +241,7 @@ public class DocFreqValueSource extends ValueSource {
|
||||||
@Override
|
@Override
|
||||||
public DocValues getValues(Map context, IndexReader reader) throws IOException {
|
public DocValues getValues(Map context, IndexReader reader) throws IOException {
|
||||||
Searcher searcher = (Searcher)context.get("searcher");
|
Searcher searcher = (Searcher)context.get("searcher");
|
||||||
// todo: we need docFreq that takes a BytesRef
|
int docfreq = searcher.docFreq(new Term(indexedField, indexedBytes));
|
||||||
String strVal = ByteUtils.UTF8toUTF16(indexedBytes);
|
|
||||||
int docfreq = searcher.docFreq(new Term(indexedField, strVal));
|
|
||||||
return new ConstIntDocValues(docfreq, this);
|
return new ConstIntDocValues(docfreq, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue