Ejemplo n.º 1
0
 public SolrSearchDocument(String id, String resourceId, String context) {
   this();
   doc.put(SearchFields.ID_FIELD_NAME, id);
   doc.put(SearchFields.URI_FIELD_NAME, resourceId);
   if (context != null) {
     doc.put(SearchFields.CONTEXT_FIELD_NAME, context);
   }
 }
Ejemplo n.º 2
0
 public SolrIndexSearchMailDocument(
     SolrDocument doc, Long rank, Map<String, Map<String, List<String>>> highlight) {
   m_doc = doc;
   m_rank = rank;
   if (null != highlight && !highlight.isEmpty()) {
     // apply highlighting changes to document
     Map<String, List<String>> hl = highlight.get(getDocumentID());
     if (null != hl)
       for (Map.Entry<String, List<String>> entry : hl.entrySet()) {
         for (String s : entry.getValue()) {
           String key = entry.getKey();
           if (!LANGUAGE.equals(key)) // don't replace language with highlighted language
           doc.put(key, s);
         }
       }
   }
 }
 public static void setScore(SolrDocument doc, double score) {
   doc.put("score", (float) score);
 }