public interface SolrSearchServiceExtensionHandler extends ExtensionHandler
| 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, isEnabledExtensionResultStatusType buildPrefixListForIndexField(IndexField field, FieldType fieldType, List<String> prefixList)
ExtensionResultStatusType filterSearchFacetRanges(SearchFacetDTO dto, List<SearchFacetRange> ranges)
context - dto - ranges - ExtensionResultStatusType modifySolrQuery(org.apache.solr.client.solrj.SolrQuery query, String qualifiedSolrQuery, List<SearchFacetDTO> facets, SearchCriteria searchCriteria, String defaultSort)
context - query - qualifiedSolrQuery - facets - searchCriteria - defaultSort - ExtensionResultStatusType modifySolrQuery(SearchContextDTO context, org.apache.solr.client.solrj.SolrQuery query, String qualifiedSolrQuery, List<SearchFacetDTO> facets, SearchCriteria searchCriteria, String defaultSort)
context - query - qualifiedSolrQuery - facets - searchCriteria - defaultSort - ExtensionResultStatusType getCategoryId(Category category, Long[] returnContainer)
ExtensionResultStatusType.HANDLED, the value placed in the 0th element
in the returnContainer should be used.category - returnContainer - 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. 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.
query - searchCriteria - indexFieldType - 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)}ExtensionResultStatusType modifySearchResults(List<org.apache.solr.common.SolrDocument> responseDocuments, List<Product> products)
Modifies 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.
responseDocuments - the response documents from Solrproducts - the products that tie to the response documentsExtensionResultStatusType getSearchFacets(List<SearchFacet> searchFacets)
searchFacets - the List to populate@Deprecated ExtensionResultStatusType attachFacet(org.apache.solr.client.solrj.SolrQuery query, String indexField, SearchFacetDTO dto)
attachFacet(SolrQuery, String, SearchFacetDTO, SearchCriteria)query - the SolrQuery to attach the facet todto - ExtensionResultStatusType attachFacet(org.apache.solr.client.solrj.SolrQuery query, String indexField, SearchFacetDTO dto, SearchCriteria searchCriteria)
query - the SolrQuery to attach the facet todto - searchCriteria - ExtensionResultStatusType setFacetResults(Map<String,SearchFacetDTO> namedFacetMap, org.apache.solr.client.solrj.response.QueryResponse response)
namedFacetMap - response - ExtensionResultStatusType buildActiveFacetFilter(FieldEntity entityType, String solrKey, String[] selectedValues, List<String> valueStrings)
buildActiveFacetFilter(SearchFacet, String[], List)entityType - solrKey - selectedValues - valueStrings - ExtensionResultStatusType buildActiveFacetFilter(SearchFacet facet, String[] selectedValues, List<String> valueStrings)
facet - selectedValues - valueStrings - ExtensionResultStatusType addAdditionalCategoryIds(Category category, SearchCriteria searchCriteria, List<Long> categoryIds)
category - 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)ExtensionResultStatusType getCategorySearchFacets(Category category, List<SearchFacet> searchFacets)
category - searchFacets - ExtensionResultStatusType getSearchableIndexFields(List<IndexField> fields)
fields - the List to be populated.ExtensionResultStatusType batchFetchCatalogData(List<Product> products)
#startBatchEvent(List).products - ExtensionResultStatusType attachSortField(org.apache.solr.client.solrj.SolrQuery solrQuery, String requestedSortFieldName, org.apache.solr.client.solrj.SolrQuery.ORDER order)
SolrQuery.solrQuery - requestedSortFieldName - order - ExtensionResultStatusType getPropertyNameForIndexField(IndexField field, FieldType fieldType, String prefix, ExtensionResultHolder<String> erh)
field - fieldType - prefix - erh - Copyright © 2018. All rights reserved.