Interface DocumentBuilderContributor<T>

  • Type Parameters:
    T - The type of the document being modified
    All Known Subinterfaces:
    IndexableTypeDocumentBuilderContributor<T>

    public interface DocumentBuilderContributor<T>
    Responsible for further contributing to a populated search document. This interface should be implemented if the user intends to enhance an indexable search document with additional information.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean canHandle​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable)
      Determines whether this contributor should contribute
      default void contribute​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable, T document, com.jayway.jsonpath.DocumentContext context, List<com.broadleafcommerce.search.api.domain.FieldDefinition> searchFields)
      Enhances an indexable document with additional information.
      void contributeInternal​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable, T document, com.jayway.jsonpath.DocumentContext context, List<com.broadleafcommerce.search.api.domain.FieldDefinition> searchFields)
      Enhances an indexable document with additional information.
    • Method Detail

      • contribute

        default void contribute​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable,
                                T document,
                                com.jayway.jsonpath.DocumentContext context,
                                List<com.broadleafcommerce.search.api.domain.FieldDefinition> searchFields)
                         throws com.broadleafcommerce.search.api.SearchIndexException
        Enhances an indexable document with additional information.
        Parameters:
        indexable - The indexable type.
        document - The search document to be enhanced.
        context - An initialized context with all properties from the Indexable mapped and available via JSON paths.
        searchFields - The search fields for this IndexableType.
        Throws:
        com.broadleafcommerce.search.api.SearchIndexException - if an error occurs preventing indexing
      • contributeInternal

        void contributeInternal​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable,
                                T document,
                                com.jayway.jsonpath.DocumentContext context,
                                List<com.broadleafcommerce.search.api.domain.FieldDefinition> searchFields)
                         throws com.broadleafcommerce.search.api.SearchIndexException
        Enhances an indexable document with additional information.
        Parameters:
        indexable - The indexable type.
        document - The search document to be enhanced.
        context - An initialized context with all properties from the Indexable mapped and available via JSON paths.
        searchFields - The search fields for this IndexableType.
        Throws:
        com.broadleafcommerce.search.api.SearchIndexException - if an error occurs preventing indexing
      • canHandle

        boolean canHandle​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable)
        Determines whether this contributor should contribute
        Parameters:
        indexable - The Indexable item.
        Returns:
        true if this contributor should execute, else false.