Exemplo n.º 1
0
        public void TestSimple()
        {
            using RangeFacetsExample example = new RangeFacetsExample();
            example.Index();
            FacetResult result = example.Search();

            assertEquals("dim=timestamp path=[] value=87 childCount=3\n  Past hour (4)\n  Past six hours (22)\n  Past day (87)\n", result.toString());
        }
Exemplo n.º 2
0
        public void TestDrillDown()
        {
            using RangeFacetsExample example = new RangeFacetsExample();
            example.Index();
            TopDocs hits = example.DrillDown(example.PAST_SIX_HOURS);

            assertEquals(22, hits.TotalHits);
        }
Exemplo n.º 3
0
        /// <summary>Runs the search and drill-down examples and prints the results.</summary>
        public static void Main(string[] args)
        {
            using RangeFacetsExample example = new RangeFacetsExample();
            example.Index();

            Console.WriteLine("Facet counting example:");
            Console.WriteLine("-----------------------");
            Console.WriteLine(example.Search());

            Console.WriteLine("\n");
            Console.WriteLine("Facet drill-down example (timestamp/Past six hours):");
            Console.WriteLine("---------------------------------------------");
            TopDocs hits = example.DrillDown(example.PAST_SIX_HOURS);

            Console.WriteLine(hits.TotalHits + " TotalHits");
        }