lucene的查询过滤
@Test
public void testBooleanQuery2() {

Term t1 = new Term("content","绅士");
Term t2 = new Term("isValid","1");

TermQuery q1 = new TermQuery(t1);
TermQuery q2 = new TermQuery(t2);

BooleanQuery query = new BooleanQuery();
query.add(q1, Occur.MUST);
query.add(q2, Occur.MUST);

queryAndPrintResult(query);
}
lunzi   2010-08-30 22:34:08 评论:1   阅读:513   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog