What is the difference between the "AND" and "+" operator?

ALso,what is the difference between a query and a filter?
For example
String[] fields={"name","address","classId"};
If I want to search the document whose classId is '4" and whose name or
address contain "Zhongzhou Road No 200",I can use two manner:
1) filter
Query q=new MKultipleFieldParser(.....).parse("Zhongzhou Road No 200");
new IndexSearcher(...).search(q,new TermFilter(new
Term("classId","4")),100);

ALso I can use:
Query q=new MKultipleFieldParser(.....).parse("Zhongzhou Road No 200");
Query classQ=new TermQuery(new Term("classId","4"));
Query all=new BooleanQuery();
all.add(q,Occur.MUST);
all.add(classQ,occur.Must);
new IndexSearcher(...).search(all,null,100);

What is the difference?

BTW,in the above exmaple,if I search "Zhongzhou Road No 200",I get no
result,however I can get some results if I search "Zhongzhou Road No
200",because there is not a term named "No" in the index.
And the search string are from client side,how to make the document contain
"Zhongzhou Road 200" can be returned when search "Zhongzhou Road No 200"?

Reply via email to