[
http://issues.apache.org/jira/browse/SOLR-30?page=comments#action_12461098 ]
giri commented on SOLR-30:
--------------------------
Hi,
I just downloaded this code and compiled it, I assume I need to use the
SolrSearcher methods. I tired the following example and getting error
SolrSearcher solrSearcher = new
SolrSearcher("http://localhost:8090/solr/select/");
List filedsList = new ArrayList();
filedsList.add("abstract");
filedsList.add("origin");
Response res = solrSearcher.search("water", filedsList,
"String");
When I run the above code, I am getting the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/codec/DecoderException
at
org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:218)
at
org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:88)
at search.SolrSearcher.search(SolrSearcher.java:104)
at search.SolrSearcher.search(SolrSearcher.java:71)
at search.TestSolr.main(TestSolr.java:21)
Any help is appreciated.
Thanks!
> Java client code for performing searches against a Solr instance
> ----------------------------------------------------------------
>
> Key: SOLR-30
> URL: http://issues.apache.org/jira/browse/SOLR-30
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Philip Jacob
> Priority: Minor
> Attachments: solrsearcher-client.zip
>
>
> Here are a few classes that connect to a Solr instance to perform searches.
> Results are returned in a Response object. The Response encapsulates a
> List<Map<String,Field>> that gives you access to the key data in the results.
> This is the main part that I'm looking for comments on.
> There are 2 dependencies for this code: JDOM and Commons HttpClient. I'll
> remove the JDOM dependency in favor of regular DOM at some point, but I think
> that the HttpClient dependency is worthwhile here. There's a lot that can be
> exploited with HttpClient that isn't demonstrated in this class. The purpose
> here is mainly to get feedback on the API of SolrSearcher before I start
> optimizing anything.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira