lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peyman Faratin <peymanfara...@gmail.com>
Subject docFreq of a Boolean query (LUCENE 4.3)
Date Tue, 17 Dec 2013 03:05:04 GMT
Hi

I know how to get the docFreq of a term in a single field (say "content" field)

int docFreqInIndex = indexReader.docFreq(new Term("content", q));

But is it possible to get the docFreq of a boolean query consisting of matches across two
or more fields? For instance, 

BooleanQuery booleanQuery = new BooleanQuery();
booleanQuery.add(new BooleanClause(new TermQuery(new Term("content", q)) , Occur.MUST));
booleanQuery.add(new BooleanClause(new TermQuery(new Term("publisher", q2)) , Occur.MUST));

docFreq API does not accept a booleanQuery. 

docFreqInIndex = indexReader.docFreq(booleanQuery);

what would be the best solution to this?
thank you


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message