实际测试
lucene范围符号,大于等于或小于等于符号[],大于或小于符号{}
 
newIntRange或newLongRange一样
 
 
代码:
          // test lucene expression
          BooleanQuery bQuery = new BooleanQuery();
         
          // test range expression
         
          // +LPUBLISHTIME1:{1 TO 3}
          NumericRangeQuery numRangeQuery1 = NumericRangeQuery.newIntRange("lpublishtime1".toUpperCase(), 1, 3, false, false);
          bQuery.add(numRangeQuery1, BooleanClause.Occur.MUST);
          System.out.println(bQuery);
         
          // +LPUBLISHTIME2:[1 TO 3}
          NumericRangeQuery numRangeQuery2 = NumericRangeQuery.newIntRange("lpublishtime2".toUpperCase(), 1, 3, true, false);
          bQuery.add(numRangeQuery2, BooleanClause.Occur.MUST);
          System.out.println(bQuery);
         
          // +LPUBLISHTIME2:[1 TO 3]
          NumericRangeQuery numRangeQuery3 = NumericRangeQuery.newIntRange("lpublishtime2".toUpperCase(), 1, 3, true, true);
          bQuery.add(numRangeQuery3, BooleanClause.Occur.MUST);
          System.out.println(bQuery);
05-11 20:17