lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/queryParser TestQueryParser.java
Date Tue, 23 Nov 2004 23:14:31 GMT
dnaber      2004/11/23 15:14:31

  Modified:    src/test/org/apache/lucene/queryParser TestQueryParser.java
  Log:
  adapt to new typesafe API
  
  Revision  Changes    Path
  1.33      +10 -2     jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java
  
  Index: TestQueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- TestQueryParser.java	6 Oct 2004 16:19:52 -0000	1.32
  +++ TestQueryParser.java	23 Nov 2004 23:14:31 -0000	1.33
  @@ -108,7 +108,7 @@
       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 @@
       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 @@
                         "+(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 {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message