Class SolrFieldService
- java.lang.Object
-
- com.broadleafcommerce.search.provider.solr.SolrFieldService
-
public class SolrFieldService extends Object
-
-
Constructor Summary
Constructors Constructor Description SolrFieldService(com.broadleafcommerce.search.api.service.FieldTypeConverter fieldTypeConverter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getNameFromSolrField(String typedSolrField)
Retrieves the field name from a Solr field name.String
getSolrField(com.broadleafcommerce.search.api.domain.FieldVariant fieldVariant, String locale)
Format the provided field variant as a Solr field name in this locale.String[]
getSolrFields(List<com.broadleafcommerce.search.api.domain.FieldVariant> fieldVariants, String locale)
Format the provided field variants as Solr field names in this locale.String
getTypeFromSolrField(String typedSolrField)
Retrieves the type from a Solr field name.
-
-
-
Method Detail
-
getSolrField
public String getSolrField(com.broadleafcommerce.search.api.domain.FieldVariant fieldVariant, @Nullable String locale)
Format the provided field variant as a Solr field name in this locale. If locale is null, or the field is not translatable, locale will not be included.- Parameters:
fieldVariant
- field variant to create a Solr field name forlocale
- (optional) the locale for the Solr field- Returns:
- Solr field name in the format "abbreviation_type_locale"
-
getSolrFields
public String[] getSolrFields(List<com.broadleafcommerce.search.api.domain.FieldVariant> fieldVariants, @Nullable String locale)
Format the provided field variants as Solr field names in this locale. If locale is null, or the fields are not translatable, locales will not be included.- Parameters:
fieldVariants
- field variants to create Solr field names forlocale
- (optional) the locale for the Solr fields- Returns:
- Solr field names in the format "abbreviation_type_locale"
-
getNameFromSolrField
public String getNameFromSolrField(String typedSolrField)
Retrieves the field name from a Solr field name.- Parameters:
typedSolrField
- Solr field name in the expected format "abbreviation_type" or "abbreviation_type_locale"- Returns:
- field name without type or locale
-
-