[ http://issues.apache.org/jira/browse/SOLR-30?page=comments#action_12421713 ] Yonik Seeley commented on SOLR-30: ----------------------------------
Hi Phil, thanks for the code! Solr's response is very generic... Solr supports custom query handlers than can return arbitrary data like category counts for faceted browsing, context snippets with highlight info, multiple query result sets, etc. Just recently highlighting info was added to the standard and dismax query handlers. It would be nice to have a way to access more generic responses. Your Response class pretty much maps to a DocList (a list of documents that match a query) or the <response> element in the XML. It's possible to have multiple of these. The <header> containing status and qtime will only appear once. Whatever mapping you come up with, there will be some peope that want something different. There should probably be some low level methods that allow one to get the InputStream or Reader of the response. This could be important, for example, if someone is asking for *all* the docs in the index and needs to stream the results. What relationship should the query client have with the update client? Probably makes sense for them to at least use the same HTTP client, even if they don't share any implementation. Should they be in the same solrclient.jar, or different solrupdater.jar, solrquery.jar? > 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
