lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "Solrj" by JanBaudisch
Date Thu, 10 Dec 2009 15:52:43 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "Solrj" page has been changed by JanBaudisch.
The comment on this change is: Code for iterating over search results does not work..
http://wiki.apache.org/solr/Solrj?action=diff&rev1=40&rev2=41

--------------------------------------------------

  Then to get back the highlight results you need something like this:
  
  {{{
-     Iterator<SolrDocument> iter = queryResponse.getResults();
+     Iterator<SolrDocument> iter = queryResponse.getResults().iterator();
  
      while (iter.hasNext()) {
        SolrDocument resultDoc = iter.next();
  
-       String content = (String) resultDoc.getFieldValue("content"));
+       String content = (String) resultDoc.getFieldValue("content");
        String id = (String) resultDoc.getFieldValue("id"); //id is the uniqueKey field
  
        if (queryResponse.getHighlighting().get(id) != null) {

Mime
View raw message