Package edu.byu.hbll.solr
Class SolrDocumentBuilder
java.lang.Object
edu.byu.hbll.solr.SolrDocumentBuilder
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomBooleanFields(Map<String, Boolean> valueMap, org.apache.solr.common.SolrInputDocument document) Method which adds custom boolean fields toSolrInputDocument.voidaddCustomIntegerFields(Map<String, Integer> valueMap, org.apache.solr.common.SolrInputDocument document) Method which adds custom integer fields toSolrInputDocument.voidaddCustomLongFields(Map<String, Long> valueMap, org.apache.solr.common.SolrInputDocument document) Method which adds custom long fields toSolrInputDocument.voidaddCustomStringFields(Map<String, String> valueMap, org.apache.solr.common.SolrInputDocument document) Method which adds custom string fields toSolrInputDocument.org.apache.solr.common.SolrInputDocumentbuildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node) Method which returns theSolrInputDocumentgenerated from theJsonNode; theSolrInputDocumentis a flattened version of theJsonNode.org.apache.solr.common.SolrInputDocumentbuildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node, Collection<String> ignoreFields) Method which returns theSolrInputDocumentgenerated from theJsonNode; theSolrInputDocumentis a flattened version of theJsonNode.
-
Constructor Details
-
SolrDocumentBuilder
public SolrDocumentBuilder()
-
-
Method Details
-
buildSolrInputDocument
public org.apache.solr.common.SolrInputDocument buildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node) Method which returns theSolrInputDocumentgenerated from theJsonNode; theSolrInputDocumentis a flattened version of theJsonNode.- Parameters:
node- theJsonNodeto be flattened.- Returns:
- the
SolrInputDocumentgenerated.
-
buildSolrInputDocument
public org.apache.solr.common.SolrInputDocument buildSolrInputDocument(com.fasterxml.jackson.databind.JsonNode node, Collection<String> ignoreFields) Method which returns theSolrInputDocumentgenerated from theJsonNode; theSolrInputDocumentis a flattened version of theJsonNode.- Parameters:
node- theJsonNodeto be flattened.ignoreFields- List of field names to ignore.- Returns:
- the
SolrInputDocumentgenerated.
-
addCustomStringFields
public void addCustomStringFields(Map<String, String> valueMap, org.apache.solr.common.SolrInputDocument document) Method which adds custom string fields toSolrInputDocument.- Parameters:
valueMap- a map containing the keys and values to be added.document- theSolrInputDocumentto 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 toSolrInputDocument.- Parameters:
valueMap- a map containing the keys and values to be added.document- theSolrInputDocumentto 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 toSolrInputDocument.- Parameters:
valueMap- a map containing the keys and values to be added.document- theSolrInputDocumentto 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 toSolrInputDocument.- Parameters:
valueMap- a map containing the keys and values to be added.document- theSolrInputDocumentto add the keys and values to.
-