多个条件搜索是这样:
String [] queries={"title", "phone"};
String[] fields={"手机", "15563636363"};
BooleanClause.Occur[] clauses={BooleanClause.Occur.MUST,BooleanClause.Occur.MUST};
Query query=MultiFieldQueryParser.parse(queries,fields,clauses,new StandardAnalyzer());
IndexSearcher mysea = new IndexSearcher("D:\luceneIndex", true);
Hits myhit= mysea.Search(query, sort);
在什么范围之间是这样:
Term beginTime=new Term("num","5");
Term endTime=new Term("num","10");
RangeQuery query=null;
query=new RangeQuery(beginTime,endTime,false);
IndexSearcher mysea = new IndexSearcher("D:\luceneIndex", true);
Hits myhit= mysea.Search(query);
怎么把两个条件组合起来,就是既可以有条件,又可以在什么范围内??