Class SolrDocumentBuilder

java.lang.Object
edu.byu.hbll.solr.SolrDocumentBuilder

public class SolrDocumentBuilder extends Object
Class which builds a solr input document from a json document. All documents in solr are flat, this class generically flattens the json document.
Author:
danielrodziewicz
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCustomBooleanFields(Map<String,Boolean> valueMap, org.apache.solr.common.SolrInputDocument document)
    Method which adds custom boolean fields to SolrInputDocument.
    void
    addCustomIntegerFields(Map<String,Integer> valueMap, org.apache.solr.common.SolrInputDocument document)
    Method which adds custom integer fields to SolrInputDocument.
    void
    addCustomLongFields(Map<String,Long> valueMap, org.apache.solr.common.SolrInputDocument document)
    Method which adds custom long fields to SolrInputDocument.
    void
    addCustomStringFields(Map<String,String> valueMap, org.apache.solr.common.SolrInputDocument document)
    Method which adds custom string fields to SolrInputDocument.
    org.apache.solr.common.SolrInputDocument
    buildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node)
    Method which returns the SolrInputDocument generated from the JsonNode; the SolrInputDocument is a flattened version of the JsonNode.
    org.apache.solr.common.SolrInputDocument
    buildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node, Collection<String> ignoreFields)
    Method which returns the SolrInputDocument generated from the JsonNode; the SolrInputDocument is a flattened version of the JsonNode.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SolrDocumentBuilder

      public SolrDocumentBuilder()
  • Method Details

    • buildSolrInputDocument

      public org.apache.solr.common.SolrInputDocument buildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node)
      Method which returns the SolrInputDocument generated from the JsonNode; the SolrInputDocument is a flattened version of the JsonNode.
      Parameters:
      node - the JsonNode to be flattened.
      Returns:
      the SolrInputDocument generated.
    • buildSolrInputDocument

      public org.apache.solr.common.SolrInputDocument buildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node, Collection<String> ignoreFields)
      Method which returns the SolrInputDocument generated from the JsonNode; the SolrInputDocument is a flattened version of the JsonNode.
      Parameters:
      node - the JsonNode to be flattened.
      ignoreFields - List of field names to ignore.
      Returns:
      the SolrInputDocument generated.
    • addCustomStringFields

      public void addCustomStringFields(Map<String,String> valueMap, org.apache.solr.common.SolrInputDocument document)
      Method which adds custom string fields to SolrInputDocument.
      Parameters:
      valueMap - a map containing the keys and values to be added.
      document - the SolrInputDocument to add the keys and values to.
    • addCustomIntegerFields

      public void addCustomIntegerFields(Map<String,Integer> valueMap, org.apache.solr.common.SolrInputDocument document)
      Method which adds custom integer fields to SolrInputDocument.
      Parameters:
      valueMap - a map containing the keys and values to be added.
      document - the SolrInputDocument to add the keys and values to.
    • addCustomBooleanFields

      public void addCustomBooleanFields(Map<String,Boolean> valueMap, org.apache.solr.common.SolrInputDocument document)
      Method which adds custom boolean fields to SolrInputDocument.
      Parameters:
      valueMap - a map containing the keys and values to be added.
      document - the SolrInputDocument to add the keys and values to.
    • addCustomLongFields

      public void addCustomLongFields(Map<String,Long> valueMap, org.apache.solr.common.SolrInputDocument document)
      Method which adds custom long fields to SolrInputDocument.
      Parameters:
      valueMap - a map containing the keys and values to be added.
      document - the SolrInputDocument to add the keys and values to.