org.broadleafcommerce.core.search.service.solr
Interface SolrHelperService

All Known Implementing Classes:
SolrHelperServiceImpl

public interface SolrHelperService

Author:
Andre Azzolini (apazzolini)

Method Summary
 String getCategoryFieldName()
           
 String getCategorySortFieldName(Category category)
           
 String getCurrentNamespace()
          Determines the current namespace we are operating on.
 Locale getDefaultLocale()
          Returns the default locale.
 String getDefaultLocalePrefix()
           
 String getExplicitCategoryFieldName()
           
 String getGlobalFacetTagField()
          This property is needed to be non-null to allow filtering by multiple facets at one time and have the results be an AND of the facets.
 String getIdFieldName()
           
 String getLocalePrefix()
          Determines if there is a locale prefix that needs to be applied to the given field for this particular request.
 String getNamespaceFieldName()
           
 String getPropertyNameForFieldFacet(Field field)
          Returns the property name for the given field and its configured facet field type.
 String getPropertyNameForFieldFacet(Field field, String prefix)
          Returns the property name for the given field, its configured facet field type, and the given prefix
 String getPropertyNameForFieldSearchable(Field field, FieldType searchableFieldType)
          Returns the property name for the given field and field type.
 String getPropertyNameForFieldSearchable(Field field, FieldType searchableFieldType, String prefix)
          Returns the property name for the given field, field type, and prefix
 String getSearchableFieldName()
           
 String getSearchableFieldName(String prefix)
           
 void swapActiveCores()
          Swaps the primary and reindex cores.
 

Method Detail

swapActiveCores

void swapActiveCores()
                     throws ServiceException
Swaps the primary and reindex cores. If the reindex core is null, we are operating in single core mode. In this scenario, no swap occurs.

Throws:
ServiceException

getCurrentNamespace

String getCurrentNamespace()
Determines the current namespace we are operating on. For example, if you have multiple sites set up, you may want to filter that here.

Returns:
the global namespace

getGlobalFacetTagField

String getGlobalFacetTagField()
This property is needed to be non-null to allow filtering by multiple facets at one time and have the results be an AND of the facets. Apart from being non-empty, the actual value does not matter.

Returns:
the non-empty global facet tag field

getPropertyNameForFieldSearchable

String getPropertyNameForFieldSearchable(Field field,
                                         FieldType searchableFieldType,
                                         String prefix)
Returns the property name for the given field, field type, and prefix

Parameters:
field -
searchableFieldType -
prefix -
Returns:
the property name for the field and fieldtype

getPropertyNameForFieldFacet

String getPropertyNameForFieldFacet(Field field,
                                    String prefix)
Returns the property name for the given field, its configured facet field type, and the given prefix

Parameters:
field -
prefix -
Returns:
the property name for the facet type of this field

getPropertyNameForFieldSearchable

String getPropertyNameForFieldSearchable(Field field,
                                         FieldType searchableFieldType)
Returns the property name for the given field and field type. This will apply the global prefix to the field, and it will also apply either the locale prefix or the pricelist prefix, depending on whether or not the field type was set to FieldType.PRICE

Parameters:
field -
searchableFieldType -
Returns:
the property name for the field and fieldtype

getPropertyNameForFieldFacet

String getPropertyNameForFieldFacet(Field field)
Returns the property name for the given field and its configured facet field type. This will apply the global prefix to the field, and it will also apply either the locale prefix or the pricelist prefix, depending on whether or not the field type was set to FieldType.PRICE

Parameters:
field -
Returns:
the property name for the facet type of this field

getNamespaceFieldName

String getNamespaceFieldName()
Returns:
the name of the field that keeps track what namespace this document belongs to

getIdFieldName

String getIdFieldName()
Returns:
the id field name, with the global prefix as appropriate

getCategoryFieldName

String getCategoryFieldName()
Returns:
the category field name, with the global prefix as appropriate

getExplicitCategoryFieldName

String getExplicitCategoryFieldName()
Returns:
the explicit category field name, with the global prefix as appropriate

getSearchableFieldName

String getSearchableFieldName(String prefix)
Parameters:
prefix -
Returns:
the searchable field name, with the global and specific prefix as appropriate

getSearchableFieldName

String getSearchableFieldName()
Returns:
the searchable field name, with the global and locale prefixes as appropriate

getCategorySortFieldName

String getCategorySortFieldName(Category category)
Parameters:
category -
Returns:
the default sort field name for this category

getLocalePrefix

String getLocalePrefix()
Determines if there is a locale prefix that needs to be applied to the given field for this particular request. By default, a locale prefix is not applicable for category, explicitCategory, or fields that have type Price. Also, it is not applicable for non-translatable fields

Returns:
the global prefix if there is one, "" if there isn't

getDefaultLocalePrefix

String getDefaultLocalePrefix()
Returns:
the default locale's prefix

getDefaultLocale

Locale getDefaultLocale()
Returns the default locale. Will cache the result for subsequent use. Note: There is no currently configured cache invalidation strategy for the the default locale. Override this method to provide for one if you need it.

Returns:
the default locale


Copyright © 2013. All Rights Reserved.