Lucene.Net.Facet.DrillDownQuery.Add C# (CSharp) Method

Add() public method

Adds one dimension of drill downs; if you pass the same dimension more than once it is OR'd with the previous cofnstraints on that dimension, and all dimensions are AND'd against each other and the base query.
public Add ( string dim ) : void
dim string
return void
        public void Add(string dim, params string[] path)
        {

            if (drillDownDims.ContainsKey(dim))
            {
                Merge(dim, path);
                return;
            }
            string indexedField = config.GetDimConfig(dim).IndexFieldName;

            BooleanQuery bq = new BooleanQuery(true); // disable coord
            bq.Add(new TermQuery(Term(indexedField, dim, path)), Occur.SHOULD);

            Add(dim, bq);
        }

Same methods

DrillDownQuery::Add ( string dim, Filter subFilter ) : void
DrillDownQuery::Add ( string dim, Query subQuery ) : void

Usage Example

Beispiel #1
0
        public virtual void TestAndOrs()
        {
            IndexSearcher searcher = NewSearcher(reader);

            // test (a/1 OR a/2) AND b/1
            DrillDownQuery q = new DrillDownQuery(config);

            q.Add("a", "1");
            q.Add("a", "2");
            q.Add("b", "1");
            TopDocs docs = searcher.Search(q, 100);

            Assert.AreEqual(5, docs.TotalHits);
        }
All Usage Examples Of Lucene.Net.Facet.DrillDownQuery::Add