0

当我执行例如“番茄酱热狗”的多词搜索时,尽管在 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                   ;                                           ;

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

4

1 回答 1

1
于 2021-08-20T18:54:13.307 回答