Lucene.Net.Search.TestSimpleFacetedSearch.HowToUse C# (CSharp) Method

HowToUse() private method

***************************************************** * SAMPLE USAGE * *****************************************************
private HowToUse ( string searchString ) : void
searchString string
return void
        void HowToUse(string searchString)
        {
            Query query = new QueryParser(Lucene.Net.Util.Version.LUCENE_29, "text", new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(searchString);

            SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new string[] { "source", "category" });
            SimpleFacetedSearch.Hits hits = sfs.Search(query, 10);

            long totalHits = hits.TotalHitCount;
            foreach (SimpleFacetedSearch.HitsPerFacet hpg in hits.HitsPerFacet)
            {
                long hitCountPerGroup = hpg.HitCount;
                SimpleFacetedSearch.FacetName facetName = hpg.Name;
                for (int i = 0; i < facetName.Length; i++)
                {
                    string part = facetName[i];
                }
                foreach (Document doc in hpg.Documents)
                {
                    string text = doc.GetField("text").StringValue;
                    System.Diagnostics.Debug.WriteLine(">>" + facetName + ": " + text);
                }
            }
        }