cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backofficesearchservices incompatible with adaptivesearchsolr?

rbespalovnc
Participant
0 Likes
246

I am super confused by the impexes in backofficesearch extension.

There is an impex `hybris/bin/modules/search-services/backofficesearchservices/resources/impex/productSearchServicesFacet/productSearchservices-facet.impex` which at the end imports several facets of type MULTISELECT:

INSERT_UPDATE AsFacet; searchConfiguration(uid); uid[unique = true]                   ; indexProperty        ; facetType(code); priority; ranged[default = false]; searchConfigurationPOS;
                     ; $backofficeSearchCfgId  ; ba01fe6d-c2ca-4cff-a699-438e4a6aaebb ; approvalStatus       ; MULTISELECT    ; 100     ; false                  ; 0                     ;
                     ; $backofficeSearchCfgId  ; 5fcbd84d-5ad3-4b8c-8bcb-2982eb58f87a ; facet_catalogVersion ; MULTISELECT    ; 100     ; false                  ; 1                     ;
                     ; $backofficeSearchCfgId  ; 86a8220b-3fc0-400e-8798-3afe09dcc973 ; facet_catalog        ; MULTISELECT    ; 100     ; false                  ; 2                     ;
                     ; $backofficeSearchCfgId  ; 3bf25fa8-d97a-42f7-8a4d-75b11dbb869d ; categoryLabel        ; MULTISELECT    ; 100     ; false                  ; 3                     ;
                     ; $backofficeSearchCfgId  ; 138c9eb7-d359-46a8-87a7-a4d2ac1c5839 ; facet_itemtype       ; MULTISELECT    ; 100     ; false                  ; 4                     ;

 When they are imported they pass through `AsFacetConfigurationInterceptor::onValidate()` from `adaptivesearch` which checks their type:

                    AsFacetType facetType = facetConfiguration.getFacetType();// 83
                    if (!searchProvider.isValidFacetType(indexType, facetType)) {// 84
                        throw new InterceptorException("Facet type cannot be used for facets: " + String.valueOf(facetType));// 86
                    } else {

Here `searchProvider` is configurable but  by default it's Solr.

But now the most interesting part: check the code of `SolrAsSearchProvider::isValidFacetType()` from the `adaptivesearchsolr` extension:

    public List<AsFacetType> getSupportedFacetTypes(final String indexType) {
        return SUPPORTED_FACET_TYPES;// 314
    }

    public boolean isValidFacetType(final String indexType, final AsFacetType facetType) {
        return this.getSupportedFacetTypes(indexType).contains(facetType);// 320
    }
 

So solr just checks the facet type against a static list, which is initialized  as:

    static {
        SUPPORTED_FACET_TYPES = List.of(AsFacetType.REFINE, AsFacetType.MULTISELECT_OR, AsFacetType.MULTISELECT_AND);// 101
    }

So... 

Solr supports MULTISELECT_OR and MULTISELECT_AND but doesn't support MULTISELECT which we're trying to import in backofficesearch.

And because of that the impex from the backofficesearch fails when I do platform update.

Am I misconfiguring something here or are these extensions incompatible?


Accepted Solutions (0)

Answers (0)

Ask a Question