Esempio n. 1
0
 public void Embedded()
 {
     var initializer = new CoreContainer.Initializer();
     var coreContainer = initializer.initialize();
     var solr = new EmbeddedSolrServer(coreContainer, "");
     solr.addBean(new Document {
         Id = "3",
         SKU = "abcd",
     });
     var updateResponse = solr.commit();
     Console.WriteLine("qtime: {0}", updateResponse.getQTime());
     solr.query(new SolrQuery("*:*")); // warm up
     var response = solr.query(new SolrQuery("*:*"));
     Console.WriteLine("qtime: {0}", response.getQTime());
     Console.WriteLine("results: {0}", response.getResults().size());
 }
Esempio n. 2
0
        public void Embedded()
        {
            var initializer   = new CoreContainer.Initializer();
            var coreContainer = initializer.initialize();
            var solr          = new EmbeddedSolrServer(coreContainer, "");

            solr.addBean(new Document {
                Id  = "3",
                SKU = "abcd",
            });
            var updateResponse = solr.commit();

            Console.WriteLine("qtime: {0}", updateResponse.getQTime());
            solr.query(new SolrQuery("*:*")); // warm up
            var response = solr.query(new SolrQuery("*:*"));

            Console.WriteLine("qtime: {0}", response.getQTime());
            Console.WriteLine("results: {0}", response.getResults().size());
        }