سؤال

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

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top