public void TestFlatten1TermPhrase() { Query query = PqF("A"); FieldQuery fq = new FieldQuery(query, true, true); HashSet<Query> flatQueries = new HashSet<Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A")); }
public void TestFlattenTermAndPhrase() { Query query = paW.Parse("A AND \"B C\""); FieldQuery fq = new FieldQuery(query, true, true); HashSet<Query> flatQueries = new HashSet<Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A"), PqF("B", "C")); }
public void TestFlattenTermAndPhrase2gram() { Query query = paB.Parse("AA AND BCD OR EFGH"); FieldQuery fq = new FieldQuery(query, true, true); HashSet<Query> flatQueries = new HashSet<Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("AA"), PqF("BC", "CD" ), PqF("EF", "FG", "GH")); }
public void testFlattenDisjunctionMaxQuery() { Query query = Dmq(Tq("A"), Tq("B"), PqF("C", "D")); FieldQuery fq = new FieldQuery(query, true, true); HashSet<Query> flatQueries = new HashSet<Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A"), Tq("B"), PqF("C", "D")); }
public void TestFlattenBoolean() { Query query = paW.Parse("A AND B OR C NOT (D AND E)"); FieldQuery fq = new FieldQuery(query, true, true); HashSet<Query> flatQueries = new HashSet<Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A"), Tq("B"), Tq("C")); }
public void TestFlattenPrefixQuery() { Query query = paW.Parse("Ter*"); FieldQuery fq = new FieldQuery(query, true, true); HashSet <Query> flatQueries = new HashSet <Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Preq("ter")); }
public void TestFlatten1TermPhrase() { Query query = PqF("A"); FieldQuery fq = new FieldQuery(query, true, true); HashSet <Query> flatQueries = new HashSet <Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A")); }
public void TestFlattenTermAndPhrase2gram() { Query query = paB.Parse("AA AND BCD OR EFGH"); FieldQuery fq = new FieldQuery(query, true, true); HashSet <Query> flatQueries = new HashSet <Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("AA"), PqF("BC", "CD"), PqF("EF", "FG", "GH")); }
public void TestFlattenTermAndPhrase() { Query query = paW.Parse("A AND \"B C\""); FieldQuery fq = new FieldQuery(query, true, true); HashSet <Query> flatQueries = new HashSet <Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A"), PqF("B", "C")); }
public void testFlattenDisjunctionMaxQuery() { Query query = Dmq(Tq("A"), Tq("B"), PqF("C", "D")); FieldQuery fq = new FieldQuery(query, true, true); HashSet <Query> flatQueries = new HashSet <Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A"), Tq("B"), PqF("C", "D")); }
public void TestFlattenBoolean() { Query query = paW.Parse("A AND B OR C NOT (D AND E)"); FieldQuery fq = new FieldQuery(query, true, true); HashSet <Query> flatQueries = new HashSet <Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("A"), Tq("B"), Tq("C")); }
public void TestFlattenMultiPhraseQuery() { var query = new MultiPhraseQuery(); query.Add(new[] { new Term(F, "a1"), new Term(F, "a2") }); query.Add(new[] { new Term(F, "b1"), new Term(F, "b2") }); var fieldQuery = new FieldQuery(query, true, true); var flatQueries = new HashSet <Query>(); fieldQuery.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("a1"), Tq("a2"), Tq("b1"), Tq("b2")); }
public void TestFlattenSpanQuery() { var clauses = new SpanQuery[] { new SpanTermQuery(new Term(F, "a")), new SpanTermQuery(new Term(F, "b")), new SpanTermQuery(new Term(F, "c")), }; var query = new SpanNearQuery(clauses, 3, true); var fieldQuery = new FieldQuery(query, true, true); var flatQueries = new HashSet <Query>(); fieldQuery.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("a"), Tq("b"), Tq("c")); }
public void TestFlattenPrefixQueryWithAnd() { Query query = paW.Parse("Ter* AND Pre*"); FieldQuery fq = new FieldQuery(query, true, true); HashSet<Query> flatQueries = new HashSet<Query>(); fq.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Preq("ter"), Preq("pre")); }
public void TestFlattenSpanQuery() { var clauses = new SpanQuery[] { new SpanTermQuery(new Term(F, "a")), new SpanTermQuery(new Term(F, "b")), new SpanTermQuery(new Term(F, "c")), }; var query = new SpanNearQuery(clauses, 3, true); var fieldQuery = new FieldQuery(query, true, true); var flatQueries = new HashSet<Query>(); fieldQuery.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("a"), Tq("b"), Tq("c")); }
public void TestFlattenMultiPhraseQuery() { var query = new MultiPhraseQuery(); query.Add(new[] { new Term(F, "a1"), new Term(F, "a2") }); query.Add(new[] { new Term(F, "b1"), new Term(F, "b2") }); var fieldQuery = new FieldQuery(query, true, true); var flatQueries = new HashSet<Query>(); fieldQuery.flatten(query, flatQueries); AssertCollectionQueries(flatQueries, Tq("a1"), Tq("a2"), Tq("b1"), Tq("b2")); }