flatten() 공개 메소드

public flatten ( Query sourceQuery, Query>.Dictionary flatQueries ) : void
sourceQuery Lucene.Net.Search.Query
flatQueries Query>.Dictionary
리턴 void
예제 #1
0
 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"));
 }
예제 #2
0
 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"));
 }
예제 #3
0
 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"));
 }
예제 #4
0
 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"));
 }
예제 #5
0
 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"));
 }
예제 #6
0
        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"));
        }
예제 #7
0
        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"));
        }
예제 #8
0
        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"));
        }
예제 #9
0
        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"));
        }
예제 #10
0
        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"));
        }
예제 #11
0
        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"));
        }
예제 #12
0
        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"));
        }
예제 #13
0
        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"));
        }
예제 #14
0
 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"));
 }
예제 #15
0
        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"));
        }
예제 #16
0
        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"));
        }