Say,search for results whose Field is 'A' or 'B'?
it seems the default is AND.
Say,search for results whose Field is 'A' or 'B'?
it seems the default is AND.
Never worked with Nutch actively, but since it's based on Lucene, shouldn't Lucene's rules apply? That is to say, the Query Parser Syntax should be applicable. See if this helps.
Hi, i was recently started working with nutch .you need to modify the query.java in nutch to get OR query exicuted. Add the code in Query.java
public void addShouldTerm(String term, String field) { clauses.add(new Clause(new Term(term), field, false, false, this.conf)); }
public void addShouldTerm(String term) { addShouldTerm(term, Clause.DEFAULT_FIELD); }
and form your query like
Query query= new Query(conf); query.addNotRequiredTerm("A"); query.addNotRequiredTerm("B"); you will get the results for A Or B.
Please correct me if any other way of doing or better way.
Never used nutch for querying (just for indexing), but the schmea.xml should conatin a defaultOperator which can be set to AND or OR.