You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Thorsten Scherler (JIRA)" <ji...@apache.org> on 2006/12/26 13:20:21 UTC

[jira] Commented: (SOLR-30) Java client code for performing searches against a Solr instance

    [ http://issues.apache.org/jira/browse/SOLR-30?page=comments#action_12460863 ] 
            
Thorsten Scherler commented on SOLR-30:
---------------------------------------

Hi all,

I had a look at the code and I do not understand a couple of things.

Since the client can request any response format by defining it in the query string I am not sure whether the 
protected Response createResponse(final String _xml, final List<String> _fields) throws SAXException, IOException, ParserConfigurationException, JDOMException {
makes so much sense at all. 

IMO the java client should make it easy to search a solr server with an e.g. custom servlet. This way we could leverage all helper classes to connect to the server into the client. What  format will be returned depends on the type defined in the query string that is the reason why I  do not thing the JDOM stuff makes sense.

Further the different "public Response search" methods lead is IMO not generic enough, why not simply use 
public Response search(String _query, List<NameValuePair> params) {
		...
	}
and returning directly the solr response. Then the calling method would need to deal with the raw response. 

> 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