Exemplo n.º 1
0
        public void TestLogging()
        {
            // Set up a simple Log4Net configuration that logs in memory.
            var memAppend = new log4net.Appender.MemoryAppender();

#if NETCOREAPP1_0
            var repository = LogManager.GetRepository(Assembly.GetEntryAssembly());
            BasicConfigurator.Configure(repository, memAppend);
#else
            BasicConfigurator.Configure(memAppend);
#endif

            BrowseRequest br = new BrowseRequest();
            br.Count  = 20;
            br.Offset = 0;

            BrowseSelection colorSel = new BrowseSelection("mycolor");
            colorSel.AddValue("yellow");
            br.AddSelection(colorSel);

            BrowseSelection makeSel = new BrowseSelection("make");
            makeSel.AddValue("rav4");
            br.AddSelection(makeSel);

            FacetSpec spec = new FacetSpec();
            spec.ExpandSelection = true;
            spec.OrderBy         = FacetSpec.FacetSortSpec.OrderHitsDesc;
            spec.MaxCount        = 15;

            br.SetFacetSpec("mycolor", spec);
            br.SetFacetSpec("id", spec);
            br.SetFacetSpec("make", spec);

            Directory ramIndexDir = CreateIndex();
            using (DirectoryReader srcReader = DirectoryReader.Open(ramIndexDir))
            {
                using (BoboMultiReader boboReader = BoboMultiReader.GetInstance(srcReader, _facetHandlers))
                {
                    using (BoboBrowser boboBrowser = new BoboBrowser(boboReader))
                    {
                        using (BrowseResult result = boboBrowser.Browse(br))
                        {
                        }
                    }
                }
            }

            var events = memAppend.GetEvents();

            Assert.AreEqual(3, events.Length);
            StringAssert.StartsWith("facetHandler loaded: id, took:", events[0].RenderedMessage);
            StringAssert.StartsWith("facetHandler loaded: make, took:", events[1].RenderedMessage);
            StringAssert.StartsWith("facetHandler loaded: mycolor, took:", events[2].RenderedMessage);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Executes the browse request
        /// </summary>
        /// <param name="browseRequest"></param>
        /// <param name="facetHandlers"></param>
        /// <param name="addDefaultFacetHandlers"></param>
        /// <returns></returns>
        public virtual BrowseResult Browse(BrowseRequest browseRequest, List <FacetHandler> facetHandlers = null, bool addDefaultFacetHandlers = true)
        {
            facetHandlers = facetHandlers ?? new List <FacetHandler>();

            if (addDefaultFacetHandlers)
            {
                foreach (var facetField in FacetFields)
                {
                    var facetAlias = facetField.Alias.FacetFieldAlias();
                    facetHandlers.Add(facetField.CreateFacetHandler());
                    var facetSpec = new FacetSpec
                    {
                        OrderBy         = facetField.ValueOrderBy,
                        ExpandSelection = facetField.ExpandSelection,
                        MinHitCount     = facetField.MinHitCount
                    };

                    browseRequest.SetFacetSpec(facetAlias, facetSpec);
                }
            }

            var searchProvider = ExamineManager.Instance.SearchProviderCollection[SearchProvider] as LuceneSearcher;
            var searcher       = (IndexSearcher)searchProvider.GetSearcher();
            var reader         = searcher.GetIndexReader();

            var boboReader = BoboIndexReader.GetInstance(reader, facetHandlers);

            IBrowsable browser = new BoboBrowser(boboReader);

            return(browser.Browse(browseRequest));
        }
Exemplo n.º 3
0
        public void TestFacetNameForSimpleFacetHandler()
        {
            BrowseRequest br = new BrowseRequest();

            br.Count  = 20;
            br.Offset = 0;

            BrowseSelection colorSel = new BrowseSelection("mycolor");

            colorSel.AddValue("yellow");
            br.AddSelection(colorSel);

            BrowseSelection makeSel = new BrowseSelection("make");

            makeSel.AddValue("rav4");
            br.AddSelection(makeSel);

            FacetSpec spec = new FacetSpec();

            spec.ExpandSelection = true;
            spec.OrderBy         = FacetSpec.FacetSortSpec.OrderHitsDesc;
            spec.MaxCount        = 15;

            br.SetFacetSpec("mycolor", spec);
            br.SetFacetSpec("id", spec);
            br.SetFacetSpec("make", spec);

            int expectedHitNum = 3;

            Directory ramIndexDir = CreateIndex();

            using (DirectoryReader srcReader = DirectoryReader.Open(ramIndexDir))
            {
                using (BoboMultiReader boboReader = BoboMultiReader.GetInstance(srcReader, _facetHandlers))
                {
                    using (BoboBrowser boboBrowser = new BoboBrowser(boboReader))
                    {
                        using (BrowseResult result = boboBrowser.Browse(br))
                        {
                            Assert.AreEqual(expectedHitNum, result.NumHits);
                        }
                    }
                }
            }
        }
        public void ApplyFacetSpec(string name, int minHitCount, int maxCount, bool expand, FacetSpec.FacetSortSpec orderBy)
        {
            FacetSpec fspec = new FacetSpec();

            fspec.MinHitCount     = minHitCount;
            fspec.MaxCount        = maxCount;
            fspec.ExpandSelection = expand;
            fspec.OrderBy         = orderBy;
            m_req.SetFacetSpec(name, fspec);
        }
Exemplo n.º 5
0
        public BrowseRequest CreateRequest(int minHitCount, BrowseSelection.ValueOperation operation, params string[] terms)
        {
            BrowseRequest req = new BrowseRequest();

            BrowseSelection sel = new BrowseSelection(AttributeHandlerName);

            foreach (String term in terms)
            {
                sel.AddValue(term);
            }
            sel.SetSelectionProperties(selectionProperties);
            sel.SelectionOperation = (operation);
            req.AddSelection(sel);
            req.Count = (50);
            FacetSpec fs = new FacetSpec();

            fs.MinHitCount = (minHitCount);
            req.SetFacetSpec(AttributeHandlerName, fs);
            return(req);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Override to get faceted results
        /// </summary>
        /// <param name="query">The query</param>
        /// <param name="searchLimit">The max number of results we want</param>
        /// <param name="offset">The number of already processed results to skip.</param>
        /// <returns>The results of the search unfiltered for the user.</returns>
        protected override RawSearchResultSet GetRawSearchResults(ICrmEntityQuery query, int searchLimit, int offset)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            var br = new BrowseRequest();

            br.Count  = searchLimit;
            br.Sort   = this.GetSortField(query);
            br.Query  = this.CreateQuery(query);
            br.Offset = offset;

            this.AddFacetConstraints(br, query.FacetConstraints);

            // add preconfigured facet specs
            foreach (var fieldToSpec in this.specs)
            {
                br.SetFacetSpec(fieldToSpec.Key, fieldToSpec.Value);
            }

            // execute the query
            IBrowsable browser = new BoboBrowser(this.boboReader);

            foreach (var facetConfiguration in this.config.GetConfiguredFacets())
            {
                if (facetConfiguration.FacetHandlerType == FacetHandlerType.Dynamic)
                {
                    browser.SetFacetHandler(facetConfiguration.FacetHandler);
                }
            }
            var browseResult = browser.Browse(br);

            stopwatch.Stop();

            ADXTrace.Instance.TraceInfo(TraceCategory.Application, string.Format("Lucene(faceted/BoboBrowse): {0} total hits ({1}ms)", browseResult.NumHits, stopwatch.ElapsedMilliseconds));

            PortalFeatureTrace.TraceInstance.LogSearch(FeatureTraceCategory.Search, browseResult.NumHits, stopwatch.ElapsedMilliseconds, string.Format("Lucene(faceted/BoboBrowse): {0} total hits ({1}ms)", browseResult.NumHits, stopwatch.ElapsedMilliseconds));

            return(this.ConvertBoboBrowseResultsToRawSearchResultSet(browseResult, offset, query.FacetConstraints));
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Lucene.Net.Util.Version version = Lucene.Net.Util.Version.LUCENE_29;

            var      dir      = new RAMDirectory();
            Analyzer analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(version),
                                                            new Dictionary <string, Analyzer> {
                { "organization", new KeywordAnalyzer() }
            });

            // Add content to the index
            var indexWriter = new IndexWriter(dir, analyzer, IndexWriter.MaxFieldLength.UNLIMITED);

            foreach (var document in CreateDocuments(CreateTestData()))
            {
                indexWriter.AddDocument(document);
            }

            indexWriter.Commit();
            indexWriter.Dispose();

            var orgFieldName   = "organization";
            var titleFieldName = "title";
            var createdAtName  = "created_at";

            var rangeFacetName = "rangeFacet";

            //var orgFacetHandler = new PathFacetHandler(orgFieldName);
            //orgFacetHandler.SetSeparator("/");
            var          orgFacetHandler       = new MultiValueFacetHandler(orgFieldName);
            FacetHandler titleFacetHandler     = new MultiValueFacetHandler(titleFieldName);
            var          createdAtFacetHandler = new SimpleFacetHandler(createdAtName);
            //var ranges = new List<string> { "[2000/01/01 TO 2000/12/30]", "[2001/01/01 TO 2007/12/30]" };
            var ranges = new List <string> {
                "[20000101 TO 20001230]", "[20040101 TO *]"
            };
            var rangeFacetHandler = new RangeFacetHandler(rangeFacetName, createdAtName, ranges);


            IndexReader reader = IndexReader.Open(dir, true);

            // decorate it with a bobo index reader
            BoboIndexReader boboReader = BoboIndexReader.GetInstance(reader, new[] { orgFacetHandler, titleFacetHandler, createdAtFacetHandler, rangeFacetHandler });

            // creating a browse request
            var browseRequest = new BrowseRequest {
                Count = 10, Offset = 0, FetchStoredFields = true
            };

            // add a selection
            //var orgSelection = new BrowseSelection(orgFieldName);
            //orgSelection.AddValue("A/B");
            //browseRequest.AddSelection(orgSelection);

            var titleSelction = new BrowseSelection(titleFieldName);

            //titleSelction.AddValue("Læge");
            browseRequest.AddSelection(titleSelction);

            browseRequest.AddSelection(new BrowseSelection(rangeFacetName));

            // parse a query
            var   parser = new QueryParser(Lucene.Net.Util.Version.LUCENE_29, "name", new KeywordAnalyzer());
            Query q      = parser.Parse("an*");

            browseRequest.Query = q;

            // add the facet output specs
            var orgSpec = new FacetSpec {
                OrderBy = FacetSpec.FacetSortSpec.OrderValueAsc
            };

            browseRequest.SetFacetSpec(orgFieldName, orgSpec);
            var titleSpec = new FacetSpec {
                MinHitCount = 1, OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc
            };

            browseRequest.SetFacetSpec(titleFieldName, titleSpec);
            //var createdAtSpec = new FacetSpec { MinHitCount = 1, OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc };
            //browseRequest.SetFacetSpec(createdAtName, createdAtSpec);
            var rangeSpec = new FacetSpec {
                MinHitCount = 1, OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc
            };

            browseRequest.SetFacetSpec(rangeFacetName, rangeSpec);

            // perform browse
            IBrowsable browser = new BoboBrowser(boboReader);

            BrowseResult result = browser.Browse(browseRequest);

            // Showing results now
            int totalHits = result.NumHits;

            BrowseHit[] hits = result.Hits;

            Dictionary <String, IFacetAccessible> facetMap = result.FacetMap;

            IFacetAccessible orgFacets = facetMap[orgFieldName];

            Console.WriteLine("Facets {0}:", orgFieldName);
            foreach (BrowseFacet facet in orgFacets.GetFacets())
            {
                Console.WriteLine(facet.ToString());
            }

            IFacetAccessible titleFacets = facetMap[titleFieldName];

            Console.WriteLine("Facets {0}:", titleFieldName);
            foreach (BrowseFacet facet in titleFacets.GetFacets())
            {
                Console.WriteLine(facet.ToString());
            }

            if (facetMap.ContainsKey(createdAtName))
            {
                IFacetAccessible createdAtFacets = facetMap[createdAtName];
                Console.WriteLine("Facets {0}:", createdAtName);
                foreach (BrowseFacet facet in createdAtFacets.GetFacets())
                {
                    Console.WriteLine(facet.ToString());
                }
            }


            if (facetMap.ContainsKey(rangeFacetName))
            {
                Console.WriteLine("-------------------------------------");
                IFacetAccessible rangeFacets = facetMap[rangeFacetName];
                Console.WriteLine("Facets {0}:", rangeFacets);
                foreach (BrowseFacet facet in rangeFacets.GetFacets())
                {
                    Console.WriteLine(facet.ToString());
                }
                Console.WriteLine("-------------------------------------");
            }


            Console.WriteLine("Actual items (total: {0}) query: {1}:", totalHits, q);
            for (int i = 0; i < hits.Length; ++i)
            {
                BrowseHit browseHit = hits[i];
                Console.WriteLine("id = {0}, Name = {1}, Organizations = {{{2}}}, Titles = {{{3}}}, Created at = {4}", browseHit.StoredFields.Get("id"), browseHit.StoredFields.Get("name"), string.Join(", ", browseHit.StoredFields.GetValues("organization").Distinct()), string.Join(", ", browseHit.StoredFields.GetValues("title").Distinct()), browseHit.StoredFields.Get("created_at"));
            }
        }
Exemplo n.º 8
0
        public void testRuntimeFilteredDateRange()
        {
            Lucene.Net.Util.Version version = Lucene.Net.Util.Version.LUCENE_29;

            var      dir      = new RAMDirectory();
            Analyzer analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(version),
                                                            new Dictionary <string, Analyzer> {
                { "organization", new KeywordAnalyzer() }
            });

            // Add content to the index
            var indexWriter = new IndexWriter(dir, analyzer, IndexWriter.MaxFieldLength.UNLIMITED);

            foreach (var document in CreateDocuments())
            {
                indexWriter.AddDocument(document);
            }

            indexWriter.Commit();
            indexWriter.Dispose();



            //var ranges = new List<string> { "[2000/01/01 TO 2001/12/30]", "[2007/01/01 TO 2007/12/30]" };
            ////var handler = new FilteredRangeFacetHandler("filtered_date", "date", ranges);
            //var handler = new RangeFacetHandler("date", new PredefinedTermListFactory<DateTime>("yyyy/MM/dd"), ranges);

            //IndexReader reader = IndexReader.Open(dir, true);

            //// decorate it with a bobo index reader
            //BoboIndexReader boboReader = BoboIndexReader.GetInstance(reader, new[] { handler });
            //IBrowsable browser = new BoboBrowser(boboReader);

            //var req = new BrowseRequest();
            //req.SetFacetSpec("filtered_date", new FacetSpec());


            //BrowseResult result = browser.Browse(req);

            //// Showing results now
            //int totalHits = result.NumHits;
            //BrowseHit[] hits = result.Hits;

            //Dictionary<String, IFacetAccessible> facetMap = result.FacetMap;


            // queries
            var dateRange = new List <String>();

            dateRange.Add("[" + DateTools.DateToString(new DateTime(1999, 1, 1), DateTools.Resolution.DAY) + " TO " + DateTools.DateToString(new DateTime(2000, 12, 30), DateTools.Resolution.DAY) + "]");
            dateRange.Add("[" + DateTools.DateToString(new DateTime(2001, 1, 1), DateTools.Resolution.DAY) + " TO *]");


            // color facet handler
            var dateHandler = new RangeFacetHandler("date", dateRange);
            var titleFacet  = new SimpleFacetHandler("title");
            var handlerList = new List <FacetHandler>()
            {
                dateHandler, titleFacet
            };


            // opening a lucene index
            IndexReader reader = IndexReader.Open(dir);

            // decorate it with a bobo index reader
            BoboIndexReader boboReader = BoboIndexReader.GetInstance(reader, handlerList);

            // creating a browse request
            var br = new BrowseRequest {
                Count = 10, Offset = 0
            };

            // add a selection
            BrowseSelection sel = new BrowseSelection("title");

            //sel.AddValue("bodyintitle");
            br.AddSelection(sel);

            // parse a query
            var   parser = new QueryParser(version, "id", new StandardAnalyzer(version));
            Query q      = parser.Parse("*:*");

            br.Query = q;

            // add the facet output specs
            FacetSpec dateSpec = new FacetSpec();

            dateSpec.OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc;
            br.SetFacetSpec("date", dateSpec);
            FacetSpec titleSpec = new FacetSpec();

            titleSpec.OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc;
            br.SetFacetSpec("title", titleSpec);

            // perform browse
            var          browser = new BoboBrowser(boboReader);
            BrowseResult result  = browser.Browse(br);

            int totalHits = result.NumHits;

            BrowseHit[] hits = result.Hits;

            Dictionary <String, IFacetAccessible> facetMap = result.FacetMap;

            IFacetAccessible dateFacets = facetMap["date"];

            Debug.WriteLine("Facets date:");
            foreach (BrowseFacet facetVal in dateFacets.GetFacets())
            {
                Debug.WriteLine("Facet " + facetVal.Value + "(" + facetVal.HitCount + ")");
            }

            IFacetAccessible orgFacets = facetMap["title"];

            Debug.WriteLine("Facets title:");
            foreach (BrowseFacet facet in orgFacets.GetFacets())
            {
                Debug.WriteLine(facet.ToString());
            }

            int i = 42;
        }
        public BrowseRequest CreateRequest(int minHitCount, BrowseSelection.ValueOperation operation, params string[] terms)
        {
            BrowseRequest req = new BrowseRequest();

            BrowseSelection sel = new BrowseSelection(AttributeHandlerName);
            foreach (String term in terms)
            {
                sel.AddValue(term);
            }
            sel.SetSelectionProperties(selectionProperties);
            sel.SelectionOperation = (operation);
            req.AddSelection(sel);
            req.Count = (50);
            FacetSpec fs = new FacetSpec();
            fs.MinHitCount = (minHitCount);
            req.SetFacetSpec(AttributeHandlerName, fs);
            return req;
        }
Exemplo n.º 10
0
        public BrowseRequest ConvertBrowseRequest(BoboRequest boboRequest)
        {
            Query query = this.queryBuilder.ParseQuery(boboRequest.Query, boboRequest.Df);
            Sort  sort  = this.queryBuilder.ParseSort(boboRequest.Sort);

            var browseRequest = new BrowseRequest();

            browseRequest.Offset = boboRequest.Start;
            browseRequest.Count  = boboRequest.Rows;
            browseRequest.Query  = query;

            if (sort != null)
            {
                SortField[] sortFields = sort.GetSort();
                if (sortFields != null && sortFields.Length > 0)
                {
                    browseRequest.Sort = sortFields;
                }
            }

            var selMap = new Dictionary <string, BrowseSelection>();

            foreach (var selection in boboRequest.Selections)
            {
                BrowseSelection sel = selMap.ContainsKey(selection.Name) ? selMap[selection.Name] : null;
                if (sel == null)
                {
                    sel = new BrowseSelection(selection.Name);
                    selMap.Add(selection.Name, sel);
                }
                foreach (var val in selection.Values)
                {
                    sel.AddValue(val);
                }

                sel.SelectionOperation = selection.SelectionOperation;

                sel.SetSelectionProperty("depth", selection.Depth.ToString());
                sel.SetSelectionProperty("strict", selection.Strict.ToString().ToLower());
            }
            if (selMap.Count > 0)
            {
                var sels = selMap.Values;
                foreach (var sel in sels)
                {
                    browseRequest.AddSelection(sel);
                }
            }

            if (boboRequest.Facet == true)
            {
                foreach (var facet in boboRequest.Facets)
                {
                    FacetSpec fspec = new FacetSpec();
                    browseRequest.SetFacetSpec(facet.Name, fspec);

                    fspec.MinHitCount     = facet.MinCount == int.MinValue ? 0 : facet.MinCount;
                    fspec.MaxCount        = facet.Limit == int.MinValue ? 100 : facet.Limit;
                    fspec.ExpandSelection = facet.Expand;
                    fspec.OrderBy         = ParseFacetSort(facet.Sort, FacetSpec.FacetSortSpec.OrderHitsDesc);
                }
            }

            return(browseRequest);
        }
        private BrowseResult PerformSearch(Query query, string indexPath, IEnumerable<Models.SelectionGroup> selectionGroups)
        {
            string[] FieldNames = new string[] { "Material", "Style", "Mounting", "Brand" };

            var handlers = new List<FacetHandler>();

            foreach (string field in FieldNames)
            {
                handlers.Add(new SimpleFacetHandler(field));
            }

            // Run the search

            // create the index reader
            var directory = FSDirectory.Open(new System.IO.DirectoryInfo(indexPath));
            var indexReader = DirectoryReader.Open(directory, true);

            //// This is how to get a searcher for executing the search, not for working with facets
            //IndexSearcher indexSearcher = new IndexSearcher(directory, true);
            //indexSearcher.Search(

            // Decorate it with the Bobo index reader
            BoboIndexReader boboReader = BoboIndexReader.GetInstance(indexReader, handlers);

            // create a browse request
            BrowseRequest browseRequest = new BrowseRequest();

            // NOTE: these must be used in production to page the results
            browseRequest.Count = 50;
            browseRequest.Offset = 0;

            browseRequest.FetchStoredFields = true;

            //Query query = new QueryParser(
            //        Lucene.Net.Util.Version.LUCENE_29,
            //        "title",
            //        new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)
            //    ).Parse(model.Phrase);

            if (selectionGroups != null)
            {
                // Add the selections to the search

                foreach (var group in selectionGroups)
                {
                    BrowseSelection sel = new BrowseSelection(group.Name);
                    foreach (var value in group.Selections)
                    {
                        sel.AddValue(value);
                    }
                    browseRequest.AddSelection(sel);
                }

            }

            browseRequest.Query = query;

            //// add the facet output specs
            //FacetSpec brandSpec = new FacetSpec();
            //brandSpec.OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc;

            //browseRequest.SetFacetSpec("Brand", brandSpec);

            foreach (var name in FieldNames)
            {
                // add the facet output specs
                FacetSpec spec = new FacetSpec();
                //spec.OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc;

                // NOTE: if this is a secondary search, we want to get the facets with 0
                // hits so the checkboxes can be set on the UI...or otherwise program the UI
                // to disable and set to 0 all of the selections that aren't in the result
                if (selectionGroups != null)
                {
                    spec.MinHitCount = 0;
                }

                browseRequest.SetFacetSpec(name, spec);
            }

            // perform browse
            IBrowsable browser = new BoboBrowser(boboReader);

            BrowseResult result = browser.Browse(browseRequest);

            return result;
        }
        private BrowseResult PerformAutoCompleteLookup(string prefix, string indexPath)
        {
            FacetHandler handler = new MultiValueFacetHandler("title");

            Directory directory = FSDirectory.Open(new System.IO.DirectoryInfo(indexPath));
            IndexReader indexReader = IndexReader.Open(directory, true);

            // decorate it with a bobo index reader
            BoboIndexReader boboReader = BoboIndexReader.GetInstance(indexReader, new FacetHandler[] { handler });

            BrowseRequest browseRequest = new BrowseRequest();
            browseRequest.Count = 8;
            browseRequest.Offset = 0;
            browseRequest.FetchStoredFields = true;

            // add a selection
            BrowseSelection sel = new BrowseSelection("title");
            //sel.AddValue("alexey");
            browseRequest.AddSelection(sel);

            // parse a query
            // NOTE: this was "Entity" originally
            QueryParser parser = new QueryParser(Lucene.Net.Util.Version.LUCENE_29, "title", new KeywordAnalyzer());
            Query q = parser.Parse("SPListItem");
            browseRequest.Query = q;

            // add the facet output specs
            FacetSpec spec = new FacetSpec();
            spec.Prefix = prefix;
            spec.OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc;

            browseRequest.SetFacetSpec("title", spec);

            // perform browse
            IBrowsable browser = new BoboBrowser(boboReader);

            BrowseResult result = browser.Browse(browseRequest);

            return result;

            //// Showing results now
            //Dictionary<String, IFacetAccessible> facetMap = result.FacetMap;

            //IFacetAccessible colorFacets = facetMap["Body"];

            //IEnumerable<BrowseFacet> facetVals = colorFacets.GetFacets();

            //Debug.WriteLine("Facets:");

            //int count = 0;
            //foreach (BrowseFacet facet in facetVals)
            //{
            //    count++;
            //    Debug.WriteLine(facet.ToString());
            //}
            //Debug.WriteLine("Total = " + count);
        }