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) {

Reply via email to