Question

I am very new to Apache Solr search engine . I have installed on my CENT OS VM and need to index the documents .Through the Apache Solr UI , I am able to put and index the document but Can I do the same through any JAVA API ? Kindly help me ... Thanks

Était-ce utile?

La solution

Try SolrJ. For Solr, here are some links to get started.

  1. Apache Solr Reference Guide
  2. Solr Wiki
  3. Yonik's Getting Started With Solr

Autres conseils

Use SolrJ

HttpSolrServer solr = new HttpSolrServer("<host>:<port>");
SolrQuery solrquery = new SolrQuery();
solrquery.setQuery("test");
solrquery.set("defType", "edismax");
solrquery.setHighlight(true);
QueryResponse queryResponse = solr.query(solrquery);
SolrDocumentList documentList = queryResponse.getResults();

Hope this helps :)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top