mirror of
https://github.com/apache/lucene.git
synced 2025-02-22 01:56:16 +00:00
adapt to new typesafe API
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150669 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
197ad763d1
commit
d040882872
@ -108,7 +108,7 @@ public class TestQueryParser extends TestCase {
|
||||
if (a == null)
|
||||
a = new SimpleAnalyzer();
|
||||
QueryParser qp = new QueryParser("field", a);
|
||||
qp.setOperator(QueryParser.DEFAULT_OPERATOR_OR);
|
||||
qp.setDefaultOperator(QueryParser.OR_OPERATOR);
|
||||
return qp;
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ public class TestQueryParser extends TestCase {
|
||||
if (a == null)
|
||||
a = new SimpleAnalyzer();
|
||||
QueryParser qp = new QueryParser("field", a);
|
||||
qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
|
||||
qp.setDefaultOperator(QueryParser.AND_OPERATOR);
|
||||
return qp.parse(query);
|
||||
}
|
||||
|
||||
@ -203,6 +203,14 @@ public class TestQueryParser extends TestCase {
|
||||
"+(apple \"steve jobs\") -(foo bar baz)");
|
||||
assertQueryEquals("+title:(dog OR cat) -author:\"bob dole\"", null,
|
||||
"+(title:dog title:cat) -author:\"bob dole\"");
|
||||
|
||||
QueryParser qp = new QueryParser("field", new StandardAnalyzer());
|
||||
// make sure OR is the default:
|
||||
assertEquals(QueryParser.OR_OPERATOR, qp.getDefaultOperator());
|
||||
qp.setDefaultOperator(QueryParser.AND_OPERATOR);
|
||||
assertEquals(QueryParser.AND_OPERATOR, qp.getDefaultOperator());
|
||||
qp.setDefaultOperator(QueryParser.OR_OPERATOR);
|
||||
assertEquals(QueryParser.OR_OPERATOR, qp.getDefaultOperator());
|
||||
}
|
||||
|
||||
public void testPunct() throws Exception {
|
||||
|
Loading…
x
Reference in New Issue
Block a user