Interface SolrCollectionResolver
- All Known Implementing Classes:
DefaultSolrCollectionResolver
public interface SolrCollectionResolver
Solr allows you to create multiple collections (a.k.a. Cores or Indexes). By default, we
typically use 2 identical copies of a collection: a foreground, or primary collection and a
background or backup collection. These collections can have arbitrary names, but they can also
have aliases. It's common to delete all of the information in a background collection, re-index
or reload that collection, and then re-alias so that the background becomes the foreground and
the foreground becomes the background.
This component provides a way to resolve the correct alias(es) for a given type.
- Author:
- Kelly Tisdell (ktisdell)
-
Method Summary
Modifier and TypeMethodDescriptiongetPrimarySolrCollectionForIndexable
(com.broadleafcommerce.search.api.domain.Indexable<?> indexable) Retrieve the correct primary (foreground) Solr alias name for the givenIndexable
.getPrimarySolrCollectionForType
(com.broadleafcommerce.search.api.type.IndexableType type) Retrieve the correct primary (foreground) Solr alias name for the givenIndexableType
.Retrieve the correct primary (foreground) Solr alias name for the given type.getSecondarySolrCollectionForIndexable
(com.broadleafcommerce.search.api.domain.Indexable<?> indexable) Retrieve the correct secondary (background) Solr alias name for the givenIndexable
.getSecondarySolrCollectionForType
(com.broadleafcommerce.search.api.type.IndexableType type) Retrieve the correct secondary (background) Solr alias name for the givenIndexableType
.Retrieve the correct secondary (background) Solr alias name for the given type.
-
Method Details
-
getPrimarySolrCollectionForType
Retrieve the correct primary (foreground) Solr alias name for the givenIndexableType
.- Parameters:
type
- Searchable type- Returns:
- The primary alias
-
getSecondarySolrCollectionForType
Retrieve the correct secondary (background) Solr alias name for the givenIndexableType
.- Parameters:
type
- Searchable type- Returns:
- The secondary alias
-
getPrimarySolrCollectionForIndexable
String getPrimarySolrCollectionForIndexable(com.broadleafcommerce.search.api.domain.Indexable<?> indexable) Retrieve the correct primary (foreground) Solr alias name for the givenIndexable
.- Parameters:
indexable
- Indexable item- Returns:
- The primary alias
-
getSecondarySolrCollectionForIndexable
String getSecondarySolrCollectionForIndexable(com.broadleafcommerce.search.api.domain.Indexable<?> indexable) Retrieve the correct secondary (background) Solr alias name for the givenIndexable
.- Parameters:
indexable
- Indexable item- Returns:
- The secondary alias
-
getPrimarySolrCollectionForType
Retrieve the correct primary (foreground) Solr alias name for the given type.- Parameters:
type
- Searchable type- Returns:
- The primary alias
-
getSecondarySolrCollectionForType
Retrieve the correct secondary (background) Solr alias name for the given type.- Parameters:
type
- Searchable type- Returns:
- The secondary alias
-