示例#1
0
 private List<Item> parseSearchResults(final SolrDocumentList results) {
   final Iterator<SolrDocument> it = results.iterator();
   final List<Item> items = new ArrayList<Item>();
   while (it.hasNext()) {
     final SolrDocument document = it.next();
     final Map<String, Object> clonedValueMap = new HashMap<String, Object>();
     final Collection<String> fieldNames = document.getFieldNames();
     for (final String fieldName : fieldNames) {
       if (!ignorableFields.contains(fieldName)) {
         clonedValueMap.put(fieldName, document.getFieldValue(fieldName));
       }
     }
     final String json = JsonSerializer.serialize(clonedValueMap);
     if (json != null) {
       items.add(ItemParser.parseItem(json));
     }
   }
   return items;
 }