public abstract class AbstractSolrSearchServiceExtensionHandler extends AbstractExtensionHandler implements SolrSearchServiceExtensionHandler
enabled, priority| Constructor and Description |
|---|
AbstractSolrSearchServiceExtensionHandler() |
| Modifier and Type | Method and Description |
|---|---|
ExtensionResultStatusType |
addAdditionalCategoryIds(Category category,
SearchCriteria searchCriteria,
List<Long> categoryIds)
Adds any additional category ids to filter by when category browsing or searching.
|
ExtensionResultStatusType |
attachFacet(org.apache.solr.client.solrj.SolrQuery query,
String indexField,
SearchFacetDTO dto)
Deprecated.
|
ExtensionResultStatusType |
attachFacet(org.apache.solr.client.solrj.SolrQuery query,
String indexField,
SearchFacetDTO dto,
SearchCriteria searchCriteria)
Attaches the given dto to the given query, if possible
|
ExtensionResultStatusType |
attachSortField(org.apache.solr.client.solrj.SolrQuery solrQuery,
String requestedSortFieldName,
org.apache.solr.client.solrj.SolrQuery.ORDER order)
Attaches the sort field, if able, to the given
SolrQuery. |
ExtensionResultStatusType |
batchFetchCatalogData(List<Product> products)
Batch fetch important collections for the entire list of products in single batch fetch queries.
|
ExtensionResultStatusType |
buildActiveFacetFilter(FieldEntity entityType,
String solrKey,
String[] selectedValues,
List<String> valueStrings)
Deprecated.
|
ExtensionResultStatusType |
buildActiveFacetFilter(SearchFacet facet,
String[] selectedValues,
List<String> valueStrings)
Builds the active facet filter query string for the given entity type and values.
|
ExtensionResultStatusType |
buildPrefixListForIndexField(IndexField field,
FieldType fieldType,
List<String> prefixList)
Returns a prefix if required for the passed in searchable field.
|
ExtensionResultStatusType |
filterSearchFacetRanges(SearchFacetDTO dto,
List<SearchFacetRange> ranges)
Builds the search facet ranges for the provided dto.
|
ExtensionResultStatusType |
getCategoryId(Category category,
Long[] returnContainer)
In certain scenarios, the requested category id might not be the one that should be used in Solr.
|
ExtensionResultStatusType |
getCategorySearchFacets(Category category,
List<SearchFacet> searchFacets)
Populates the List of SearchFacet's for the given Category, or else returns NOT_HANDLED
|
ExtensionResultStatusType |
getPropertyNameForIndexField(IndexField field,
FieldType fieldType,
String prefix,
ExtensionResultHolder<String> erh)
Extension point to allow overriding the way the property name for an index field with the given field type and prefix is built.
|
ExtensionResultStatusType |
getQueryField(org.apache.solr.client.solrj.SolrQuery query,
SearchCriteria searchCriteria,
IndexFieldType indexFieldType,
ExtensionResultHolder<List<String>> queryFieldsResult)
Finds and adds the query fields for the given search field and searchable field type.
|
ExtensionResultStatusType |
getSearchableIndexFields(List<IndexField> fields)
Populated the List of searchable IndexField's that will be used in building the query fields (qf) for a Solr query.
|
ExtensionResultStatusType |
getSearchFacets(List<SearchFacet> searchFacets)
Populates the List of SearchFacet's, or else returns NOT_HANDLED
|
ExtensionResultStatusType |
modifySearchResults(List<org.apache.solr.common.SolrDocument> responseDocuments,
List<Product> products)
Modifies the product search results from a Solr query
|
ExtensionResultStatusType |
modifySolrQuery(SearchContextDTO context,
org.apache.solr.client.solrj.SolrQuery query,
String qualifiedSolrQuery,
List<SearchFacetDTO> facets,
SearchCriteria searchCriteria,
String defaultSort)
Provides an extension point to modify the SolrQuery.
|
ExtensionResultStatusType |
modifySolrQuery(org.apache.solr.client.solrj.SolrQuery query,
String qualifiedSolrQuery,
List<SearchFacetDTO> facets,
SearchCriteria searchCriteria,
String defaultSort)
Provides an extension point to modify the SolrQuery.
|
ExtensionResultStatusType |
setFacetResults(Map<String,SearchFacetDTO> namedFacetMap,
org.apache.solr.client.solrj.response.QueryResponse response)
Attaches any additional facet results to the namedFacetMap if they exist.
|
getPriority, isEnabled, setEnabled, setPriorityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPriority, isEnabledpublic AbstractSolrSearchServiceExtensionHandler()
public ExtensionResultStatusType buildPrefixListForIndexField(IndexField field, FieldType fieldType, List<String> prefixList)
SolrSearchServiceExtensionHandlerbuildPrefixListForIndexField in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType filterSearchFacetRanges(SearchFacetDTO dto, List<SearchFacetRange> ranges)
SolrSearchServiceExtensionHandlerfilterSearchFacetRanges in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType modifySolrQuery(org.apache.solr.client.solrj.SolrQuery query, String qualifiedSolrQuery, List<SearchFacetDTO> facets, SearchCriteria searchCriteria, String defaultSort)
SolrSearchServiceExtensionHandlermodifySolrQuery in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType modifySolrQuery(SearchContextDTO context, org.apache.solr.client.solrj.SolrQuery query, String qualifiedSolrQuery, List<SearchFacetDTO> facets, SearchCriteria searchCriteria, String defaultSort)
SolrSearchServiceExtensionHandlermodifySolrQuery in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType getQueryField(org.apache.solr.client.solrj.SolrQuery query, SearchCriteria searchCriteria, IndexFieldType indexFieldType, ExtensionResultHolder<List<String>> queryFieldsResult)
SolrSearchServiceExtensionHandlerFinds and adds the query fields for the given search field and searchable field type. This method should only ADD to the list within the queryFieldsResult parameters.
Most implementations of this will need to invoke SolrHelperService.getPropertyNameForIndexField(IndexField, FieldType)
in order to return the right value to populate in the queryFieldsResult. If the returned result is
ExtensionResultStatusType.NOT_HANDLED then the default behavior is to only do that.
getQueryField in interface SolrSearchServiceExtensionHandlerindexFieldType - the field type of the fieldqueryFieldsResult - the binding result that contains the list of query fields, only add to this @return the result of the handler, if NOT_HANDLED, then no query fields were addedSolrHelperService#getPropertyNameForIndexField(IndexField, FieldType)}public ExtensionResultStatusType modifySearchResults(List<org.apache.solr.common.SolrDocument> responseDocuments, List<Product> products)
SolrSearchServiceExtensionHandlerModifies the product search results from a Solr query
The parameters passed into this method should be assumed to be sorted identically and match one to one.
modifySearchResults in interface SolrSearchServiceExtensionHandlerresponseDocuments - the response documents from Solrproducts - the products that tie to the response documentspublic ExtensionResultStatusType getSearchFacets(List<SearchFacet> searchFacets)
SolrSearchServiceExtensionHandlergetSearchFacets in interface SolrSearchServiceExtensionHandlersearchFacets - the List to populate@Deprecated public ExtensionResultStatusType attachFacet(org.apache.solr.client.solrj.SolrQuery query, String indexField, SearchFacetDTO dto)
attachFacet(SolrQuery, String, SearchFacetDTO, SearchCriteria)SolrSearchServiceExtensionHandlerattachFacet in interface SolrSearchServiceExtensionHandlerquery - the SolrQuery to attach the facet topublic ExtensionResultStatusType attachFacet(org.apache.solr.client.solrj.SolrQuery query, String indexField, SearchFacetDTO dto, SearchCriteria searchCriteria)
SolrSearchServiceExtensionHandlerattachFacet in interface SolrSearchServiceExtensionHandlerquery - the SolrQuery to attach the facet topublic ExtensionResultStatusType setFacetResults(Map<String,SearchFacetDTO> namedFacetMap, org.apache.solr.client.solrj.response.QueryResponse response)
SolrSearchServiceExtensionHandlersetFacetResults in interface SolrSearchServiceExtensionHandler@Deprecated public ExtensionResultStatusType buildActiveFacetFilter(FieldEntity entityType, String solrKey, String[] selectedValues, List<String> valueStrings)
SolrSearchServiceExtensionHandlerbuildActiveFacetFilter in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType buildActiveFacetFilter(SearchFacet facet, String[] selectedValues, List<String> valueStrings)
SolrSearchServiceExtensionHandlerbuildActiveFacetFilter in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType addAdditionalCategoryIds(Category category, SearchCriteria searchCriteria, List<Long> categoryIds)
SolrSearchServiceExtensionHandleraddAdditionalCategoryIds in interface SolrSearchServiceExtensionHandlercategory - the current Category we are browsing or searching onsearchCriteria - the criteria for the current querycategoryIds - the category IDs we are going to filter on (this already includes the current category's ID)public ExtensionResultStatusType getCategorySearchFacets(Category category, List<SearchFacet> searchFacets)
SolrSearchServiceExtensionHandlergetCategorySearchFacets in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType getSearchableIndexFields(List<IndexField> fields)
SolrSearchServiceExtensionHandlergetSearchableIndexFields in interface SolrSearchServiceExtensionHandlerfields - the List to be populated.public ExtensionResultStatusType getCategoryId(Category category, Long[] returnContainer)
SolrSearchServiceExtensionHandlerExtensionResultStatusType.HANDLED, the value placed in the 0th element
in the returnContainer should be used.getCategoryId in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType batchFetchCatalogData(List<Product> products)
SolrSearchServiceExtensionHandler#startBatchEvent(List).batchFetchCatalogData in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType attachSortField(org.apache.solr.client.solrj.SolrQuery solrQuery, String requestedSortFieldName, org.apache.solr.client.solrj.SolrQuery.ORDER order)
SolrSearchServiceExtensionHandlerSolrQuery.attachSortField in interface SolrSearchServiceExtensionHandlerpublic ExtensionResultStatusType getPropertyNameForIndexField(IndexField field, FieldType fieldType, String prefix, ExtensionResultHolder<String> erh)
SolrSearchServiceExtensionHandlergetPropertyNameForIndexField in interface SolrSearchServiceExtensionHandlerCopyright © 2020. All rights reserved.