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

Was it helpful?

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

OTHER TIPS

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 :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top