【问题标题】:Hybris multi word product search not working properlyHybris 多词产品搜索无法正常工作
【发布时间】:2021-08-12 08:19:02
【问题描述】:

当我执行多词搜索(例如“番茄酱热狗”)时,尽管已在 SOLR 中为以下产品编制索引:

  • 名称:番茄酱热狗
  • 名称:番茄酱温和
  • 名称:大热狗

SOLR 结果按以下顺序显示:

  1. 名称:大热狗
  2. 名称:番茄酱温和
  3. 名称:番茄酱热狗

而不是将“番茄酱热狗”放在首位,因为它是完全匹配的。

我目前的配置是:

Free text Search:
INSERT_UPDATE SolrSearchQueryProperty; indexedProperty(name, solrIndexedType(identifier))[unique = true]; searchQueryTemplate(name, indexedType(identifier))[unique = true][default = DEFAULT:$solrIndexedType]; ftsQuery[default = false]; ftsQueryBoost; ftsQueryMinTermLength[default = 2];
                                 ; name:$solrIndexedType                                            ;                                                                                                      ; TRUE                     ; 1000         ;                                   ;
                                 ; description:$solrIndexedType                                     ;                                                                                                      ;                          ;              ;                                   ;
                                 ; summary:$solrIndexedType                                         ;                                                                                                      ;                          ;              ;                                   ;
                                 ; manufacturerName:$solrIndexedType                                ;                                                                                                      ; TRUE                     ; 40           ;                                   ;
                                 ; manufacturerAID:$solrIndexedType                                 ;                                                                                                      ; TRUE                     ; 100          ;                                   ;
                                 ; brandName:$solrIndexedType                                       ;                                                                                                      ; TRUE                     ; 800          ;                                   ;
                                 ; categoryName:$solrIndexedType                                    ;                                                                                                      ;                          ;              ;                                   ;
                                 ; allCategories:$solrIndexedType                                   ;                                                                                                      ;                          ;              ;                                   ;
                                 ; category:$solrIndexedType                                        ;                                                                                                      ;                          ;              ;                                   ;
                                 ; brand:$solrIndexedType                                           ;                                                                                                      ; TRUE                     ; 800          ;                                   ;



Fuzzy Search:
INSERT_UPDATE SolrSearchQueryProperty; indexedProperty(name, solrIndexedType(identifier))[unique = true]; searchQueryTemplate(name, indexedType(identifier))[unique = true][default = DEFAULT:$solrIndexedType]; ftsFuzzyQuery[default = false]; ftsFuzzyQueryBoost; ftsFuzzyQueryMinTermLength[default = 2]; ftsFuzzyQueryFuzziness[default = 1];
                                 ; name:$solrIndexedType                                            ;                                                                                                      ; TRUE                          ; 100               ;                                        ;                                    ;
                                 ; description:$solrIndexedType                                     ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; summary:$solrIndexedType                                         ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; manufacturerName:$solrIndexedType                                ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; manufacturerAID:$solrIndexedType                                 ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; brandName:$solrIndexedType                                       ;                                                                                                      ; TRUE                          ; 80                ;                                        ;                                    ;
                                 ; categoryName:$solrIndexedType                                    ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; allCategories:$solrIndexedType                                   ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; category:$solrIndexedType                                        ;                                                                                                      ;                               ;                   ;                                        ;                                    ;
                                 ; brand:$solrIndexedType                                           ;                                                                                                      ; TRUE                          ; 80                ;                                        ;                                    ;

Phrase Search:
INSERT_UPDATE SolrSearchQueryProperty; indexedProperty(name, solrIndexedType(identifier))[unique = true]; searchQueryTemplate(name, indexedType(identifier))[unique = true][default = DEFAULT:$solrIndexedType]; ftsPhraseQuery[default = false]; ftsPhraseQueryBoost; ftsPhraseQuerySlop[default = 6];
                                 ; name:$solrIndexedType                                            ;                                                                                                      ; TRUE                           ; 1500               ;                                ;
                                 ; description:$solrIndexedType                                     ;                                                                                                      ;                                ;                    ;                                ;
                                 ; summary:$solrIndexedType                                         ;                                                                                                      ;                                ;                    ;                                ;
                                 ; manufacturerName:$solrIndexedType                                ;                                                                                                      ;                                ; 80                 ;                                ;
                                 ; manufacturerAID:$solrIndexedType                                 ;                                                                                                      ;                                ;                    ;                                ;
                                 ; brandName:$solrIndexedType                                       ;                                                                                                      ; TRUE                           ; 1000               ;                                ;
                                 ; categoryName:$solrIndexedType                                    ;                                                                                                      ;                                ;                    ;                                ;
                                 ; allCategories:$solrIndexedType                                   ;                                                                                                      ;                                ;                    ;                                ;
                                 ; category:$solrIndexedType                                        ;                                                                                                      ;                                ;                    ;                                ;
                                 ; brand:$solrIndexedType                                           ;                                                                                                      ; TRUE                           ; 1000               ;                                ;


Wildcard Query
INSERT_UPDATE SolrSearchQueryProperty; indexedProperty(name, solrIndexedType(identifier))[unique = true]; searchQueryTemplate(name, indexedType(identifier))[unique = true][default = DEFAULT:$solrIndexedType]; ftsWildcardQuery[default = false]; ftsWildcardQueryType(code)[default = POSTFIX]; ftsWildcardQueryBoost; ftsWildcardQueryMinTermLength[default = 2];
                                 ; name:$solrIndexedType                                            ;                                                                                                      ; TRUE                             ;                                              ; 10                   ;                                           ;
                                 ; description:$solrIndexedType                                     ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; summary:$solrIndexedType                                         ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; manufacturerName:$solrIndexedType                                ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; manufacturerAID:$solrIndexedType                                 ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; brandName:$solrIndexedType                                       ;                                                                                                      ; TRUE                             ;                                              ; 40                   ;                                           ;
                                 ; categoryName:$solrIndexedType                                    ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; allCategories:$solrIndexedType                                   ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; category:$solrIndexedType                                        ;                                                                                                      ;                                  ;                                              ; 0                    ;                                           ;
                                 ; brand:$solrIndexedType                                           ;                                                                                                      ; TRUE                             ;                                              ; 45                   ;                                           ;

为了实现更准确的多词搜索,我必须修改哪些参数?

【问题讨论】:

    标签: solr hybris solrcloud hybris-data-hub


    【解决方案1】:

    建议

    • 将查询参数sow=false 与standard/”lucene” 和edismax 查询解析器一起使用以启用查询时多词同义词。

    • 在您的query-time analyzer 中切换到SynonymGraphFilter。在大多数情况下,您不希望在 index-time analyzer 中包含任何类型的同义词扩展。

    • 将expand="true" 选项(或保留默认值,相同)指定为SynonymGraphFilter,以便将所有备选方案添加到查询中。

    • 请注意,当在具有不同(足够)query-time analysis 的字段上使用带有 edismax 的 sow=false 时,生成的查询形式将不同于 sow=true 时生成的查询形式;这个区别can change both matching and ranking。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-04
    • 2021-11-10
    • 2017-01-28
    • 2013-12-23
    相关资源
    最近更新 更多