You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Paul Treszczotko <pt...@input.com> on 2008/02/19 21:08:38 UTC

Converting Solr results to java query/collection/map object

Hi,
I'm pretty new to SOLR and I'd like to ask your opinion on the best practice for converting XML results you get from SOLR into something that is better fit to display on a webpage. I'm looking for performance and relatively small footprint, perhaps ability to paginate thru the result set and display/process N results at a time. Any ideas? Any tutorials you can point me to? Thanks!

pt

Re: Solr 1.2 example apps

Posted by Chris Hostetter <ho...@fucit.org>.
: Is there a repository of sample applications for SOLR; something more 
: than what comes with the installer? I'm particularly interested in 
: faceted browsing. I have located an example from developerWorks but it 
: seems to be not working with 1.2.

i provided an example with some faceting in my Apachecon talk that was 
entirely "discovered" data (ie: i just found a CSV online and created a 
demo arround it) ...

http://people.apache.org/~hossman/apachecon2007us/




-Hoss


Solr 1.2 example apps

Posted by Paul Treszczotko <pt...@input.com>.
Is there a repository of sample applications for SOLR; something more than what comes with the installer? I'm particularly interested in faceted browsing. I have located an example from developerWorks but it seems to be not working with 1.2.

pt



Paul Treszczotko
Architect, Client Systems
INPUT
11720 Plaza America Drive, Suite 1200 Reston, Virginia 20190
Direct: 703-707-3524; Fax 703-707-6201
This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email and any such files in error and that any use, dissemination, forwarding, printing or copying of this email and/or any such files is strictly prohibited. If you have received this email in error please immediately notify postmaster@input.com and destroy the original message and any such files.

Re: Converting Solr results to java query/collection/map object

Posted by Brian Whitman <br...@variogr.am>.
On Feb 19, 2008, at 3:08 PM, Paul Treszczotko wrote:

> Hi,
> I'm pretty new to SOLR and I'd like to ask your opinion on the best  
> practice for converting XML results you get from SOLR into something  
> that is better fit to display on a webpage. I'm looking for  
> performance and relatively small footprint, perhaps ability to  
> paginate thru the result set and display/process N results at a  
> time. Any ideas? Any tutorials you can point me to? Thanks!
>

Paul, this is what solrj is for.

SolrQuery q = new SolrQuery();
q.setRows(10);
q.setStart(40);
q.setQuery("type:dogs");
QueryResponse rq = solrServer.query(q);
for( SolrDocument d : rq.getResults() ) {
	String dogname = (String)d.getFieldValue("name");
...