lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avlesh Singh <avl...@gmail.com>
Subject Re: How to iterate the solrdocumentlist result
Date Mon, 04 May 2009 06:15:16 GMT
SolrDocumentList extends an ArrayList. You can iterate on it the way you
would do on a list. Here's an example

for(SolrDocument doc : listingSearchResponse.getResults()){
>   System.out.print(doc.getFieldValue("yourFieldName"));
> }
>

Cheers
Avlesh

On Mon, May 4, 2009 at 10:36 AM, ahmed baseet <ahmed.baseet@gmail.com>wrote:

> Hi All,
> I'm able to get the whole result bundle by using the following method,
>
>           QueryResponse qr = server.query(query);
>
>            SolrDocumentList sdl = qr.getResults();
>
> but I'm not able to iterate over the results. I converted this to string
> and
> displayed that and that is a full result bundle, I think its in XML.
> Actually I want to display the result in a browser and each one separately,
> I mean not as a bundle. There must be some standard methods for this, right
> ? Can some one give me some pointers in this regard... I'm trying to
> integrate the java method calls withing html code itself[ the solr server
> is
> on my box, and I want to do the testing on my box, so I want to access the
> indexer from my local box's browser only]. Any good ideas on this?
>
> Thanks,
> Ahmed.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message