Class DiscriminatorMultiTenancyStrategy

java.lang.Object
org.hibernate.search.backend.elasticsearch.multitenancy.impl.DiscriminatorMultiTenancyStrategy
All Implemented Interfaces:
MultiTenancyStrategy

public class DiscriminatorMultiTenancyStrategy extends Object implements MultiTenancyStrategy
  • Constructor Details

    • DiscriminatorMultiTenancyStrategy

      public DiscriminatorMultiTenancyStrategy()
  • Method Details

    • indexSchemaRootContributor

      public Optional<IndexSchemaRootContributor> indexSchemaRootContributor()
      Specified by:
      indexSchemaRootContributor in interface MultiTenancyStrategy
      Returns:
      A schema contributor for the required additional properties (tenant ID, ...), or an empty optional.
    • documentIdHelper

      public DocumentIdHelper documentIdHelper()
      Specified by:
      documentIdHelper in interface MultiTenancyStrategy
      Returns:
      A helper for creating predicates from tenant IDs.
    • documentMetadataContributor

      public Optional<DocumentMetadataContributor> documentMetadataContributor()
      Specified by:
      documentMetadataContributor in interface MultiTenancyStrategy
      Returns:
      A metadata contributor for the required additional properties (tenant ID, ...), or an empty optional.
    • filterOrNull

      public com.google.gson.JsonObject filterOrNull(String tenantId)
      Description copied from interface: MultiTenancyStrategy
      Generate a filter for the given tenant ID, to be applied to search queries.
      Specified by:
      filterOrNull in interface MultiTenancyStrategy
      Parameters:
      tenantId - The tenant id.
      Returns:
      The filter, or null if no filter is necessary.
    • filterOrNull

      public com.google.gson.JsonObject filterOrNull(Set<String> tenantIds)
      Description copied from interface: MultiTenancyStrategy
      Generate a filter for the given tenant IDs, to be applied to search queries.
      Specified by:
      filterOrNull in interface MultiTenancyStrategy
      Parameters:
      tenantIds - The set of tenant ids.
      Returns:
      The filter, or null if no filter is necessary.
    • idProjectionExtractionHelper

      public org.hibernate.search.backend.elasticsearch.multitenancy.impl.DiscriminatorMultiTenancyStrategy.DiscriminatorMultiTenancyIdProjectionExtractionHelper idProjectionExtractionHelper()
      Specified by:
      idProjectionExtractionHelper in interface MultiTenancyStrategy
      Returns:
      A helper for projections that need to extract the document id from search hits.