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:
Robert Muir 2010-12-26 16:56:26 +00:00
parent 42f25e65e0
commit 21db53c2a4
1 changed files with 1 additions and 4 deletions

View File

@ -23,7 +23,6 @@ import org.apache.lucene.search.Searcher;
import org.apache.lucene.util.BytesRef;
import org.apache.solr.search.MutableValueInt;
import org.apache.solr.search.MutableValue;
import org.apache.solr.util.ByteUtils;
import java.io.IOException;
import java.util.Map;
@ -242,9 +241,7 @@ public class DocFreqValueSource extends ValueSource {
@Override
public DocValues getValues(Map context, IndexReader reader) throws IOException {
Searcher searcher = (Searcher)context.get("searcher");
// todo: we need docFreq that takes a BytesRef
String strVal = ByteUtils.UTF8toUTF16(indexedBytes);
int docfreq = searcher.docFreq(new Term(indexedField, strVal));
int docfreq = searcher.docFreq(new Term(indexedField, indexedBytes));
return new ConstIntDocValues(docfreq, this);
}