本文整理汇总了Java中org.apache.lucene.util.automaton.RegExp.NONE属性的典型用法代码示例。如果您正苦于以下问题:Java RegExp.NONE属性的具体用法?Java RegExp.NONE怎么用?Java RegExp.NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.lucene.util.automaton.RegExp
的用法示例。
在下文中一共展示了RegExp.NONE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertSame
/** check that the # of hits is the same as if the query
* is run against the inverted index
*/
protected void assertSame(String regexp) throws IOException {
RegexpQuery docValues = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
docValues.setRewriteMethod(new DocTermOrdsRewriteMethod());
RegexpQuery inverted = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
TopDocs invertedDocs = searcher1.search(inverted, 25);
TopDocs docValuesDocs = searcher2.search(docValues, 25);
CheckHits.checkEqual(inverted, invertedDocs.scoreDocs, docValuesDocs.scoreDocs);
}
示例2: testEquals
public void testEquals() throws Exception {
RegexpQuery a1 = new RegexpQuery(new Term(fieldName, "[aA]"), RegExp.NONE);
RegexpQuery a2 = new RegexpQuery(new Term(fieldName, "[aA]"), RegExp.NONE);
RegexpQuery b = new RegexpQuery(new Term(fieldName, "[bB]"), RegExp.NONE);
assertEquals(a1, a2);
assertFalse(a1.equals(b));
a1.setRewriteMethod(new DocTermOrdsRewriteMethod());
a2.setRewriteMethod(new DocTermOrdsRewriteMethod());
b.setRewriteMethod(new DocTermOrdsRewriteMethod());
assertEquals(a1, a2);
assertFalse(a1.equals(b));
QueryUtils.check(a1);
}
示例3: assertSame
/** check that the # of hits is the same as from a very
* simple regexpquery implementation.
*/
protected void assertSame(String regexp) throws IOException {
RegexpQuery smart = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
DumbRegexpQuery dumb = new DumbRegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
TopDocs smartDocs = searcher1.search(smart, 25);
TopDocs dumbDocs = searcher2.search(dumb, 25);
CheckHits.checkEqual(smart, smartDocs.scoreDocs, dumbDocs.scoreDocs);
}
示例4: assertSame
/** Test fieldcache rewrite against filter rewrite */
@Override
protected void assertSame(String regexp) throws IOException {
RegexpQuery fieldCache = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
fieldCache.setRewriteMethod(new FieldCacheRewriteMethod());
RegexpQuery filter = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
filter.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);
TopDocs fieldCacheDocs = searcher1.search(fieldCache, 25);
TopDocs filterDocs = searcher2.search(filter, 25);
CheckHits.checkEqual(fieldCache, fieldCacheDocs.scoreDocs, filterDocs.scoreDocs);
}
示例5: testEquals
public void testEquals() throws Exception {
RegexpQuery a1 = new RegexpQuery(new Term(fieldName, "[aA]"), RegExp.NONE);
RegexpQuery a2 = new RegexpQuery(new Term(fieldName, "[aA]"), RegExp.NONE);
RegexpQuery b = new RegexpQuery(new Term(fieldName, "[bB]"), RegExp.NONE);
assertEquals(a1, a2);
assertFalse(a1.equals(b));
a1.setRewriteMethod(new FieldCacheRewriteMethod());
a2.setRewriteMethod(new FieldCacheRewriteMethod());
b.setRewriteMethod(new FieldCacheRewriteMethod());
assertEquals(a1, a2);
assertFalse(a1.equals(b));
QueryUtils.check(a1);
}
示例6: assertSame
/** check that the # of hits is the same as if the query
* is run against the inverted index
*/
protected void assertSame(String regexp) throws IOException {
RegexpQuery docValues = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
docValues.setRewriteMethod(new DocTermOrdsRewriteMethod());
RegexpQuery inverted = new RegexpQuery(new Term(fieldName, regexp), RegExp.NONE);
TopDocs invertedDocs = searcher1.search(inverted, 25);
TopDocs docValuesDocs = searcher2.search(docValues, 25);
CheckHits.checkEqual(inverted, invertedDocs.scoreDocs, docValuesDocs.scoreDocs);
}