Interface DocumentBuilder<T>

Type Parameters:
T - the document type for the search engine
All Known Implementing Classes:
AbstractDocumentBuilder, OpenSearchDocumentBuilder

public interface DocumentBuilder<T>
Transforms an XML document to te appropriate format for the search engine.
  • Method Summary

    Modifier and Type
    Method
    Description
    build(String site, String id, String xml, boolean ignoreRootInFieldNames)
    Builds a document from the input XML.
    build(String site, String id, Map<String,List<String>> fields)
    Builds a document from the provided multi value map of fields
  • Method Details

    • build

      T build(String site, String id, String xml, boolean ignoreRootInFieldNames) throws DocumentBuildException
      Builds a document from the input XML.
      Parameters:
      site - the Crafter site name the content belongs to
      id - value for the "localId" field in the document (final doc id is built as site:localId)
      xml - the input XML
      ignoreRootInFieldNames - ignore the root element of the input XML in field names
      Returns:
      the document
      Throws:
      DocumentBuildException
    • build

      T build(String site, String id, Map<String,List<String>> fields) throws DocumentBuildException
      Builds a document from the provided multi value map of fields
      Parameters:
      site - the Crafter site name the content belongs to
      id - value for the "localId" field in the document (final doc id is built as site:localId)
      fields - fields to add to the document.
      Returns:
      the document
      Throws:
      DocumentBuildException