use of org.apache.lucene.sandbox.queries.regex.RegexQuery in project Krill by KorAP.
the class TestRelationIndex method testRelationWithRegex.
@Test
public void testRelationWithRegex() throws IOException {
ki.addDoc(createFieldDoc0());
ki.addDoc(createFieldDoc3());
ki.commit();
SpanQuery sq;
sq = new SpanRelationQuery(new SpanMultiTermQueryWrapper<RegexQuery>(new RegexQuery(new Term("base", ">:xip/.*"))), true, RelationDirection.RIGHT);
kr = ki.search(sq, (short) 10);
assertEquals((long) 7, kr.getTotalResults());
sq = new SpanRelationQuery(new SpanMultiTermQueryWrapper<RegexQuery>(new RegexQuery(new Term("base", "<:xip/.*"))), true, RelationDirection.LEFT);
kr = ki.search(sq, (short) 10);
assertEquals((long) 7, kr.getTotalResults());
}
Aggregations