Exemplo n.º 1
0
        public void Update()
        {
            var solrSearcher = new SolrSearcher("http://localhost:8983/solr/", Mode.ReadWrite);
            ISolrSearcher searcher = new SolrSearcherAdapter(solrSearcher);
            var updater = new SolrUpdater(solrSearcher);
            ISolrUpdater s = new SolrUpdaterAdapter(updater);

            var doc = new SolrIndexDocument();
            s.PostToIndex(doc);
            s.Commit();
        }
Exemplo n.º 2
0
        public void Query()
        {
            var solrSearcher = new SolrSearcher("http://localhost:8983/solr/", Mode.ReadWrite);
            ISolrSearcher searcher = new SolrSearcherAdapter(solrSearcher);
            var updater = new SolrUpdater(solrSearcher);
            ISolrUpdater s = new SolrUpdaterAdapter(updater);
            ISolrQueryBuilder qb = new SolrQueryBuilder(searcher);

            qb.Query = new Query();
            var parameters = new List<QueryParameter>();
            parameters.Add(new QueryParameter("price", "[500 TO 1000]"));
            var qp = new QueryParameterCollection("q", parameters);
            qb.Query.AddQueryParameters(qp, ParameterJoin.AND);
            var results = new SolrSearchResults(qb);
            Console.WriteLine(results.TotalResults);
        }
Exemplo n.º 3
0
 public SolrUpdaterAdapter(SolrUpdater updater)
 {
     this.updater = updater;
 }