Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting Hybris-Solr排序_Sorting_Solr_Hybris - Fatal编程技术网

Sorting Hybris-Solr排序

Sorting Hybris-Solr排序,sorting,solr,hybris,Sorting,Solr,Hybris,我修改了代码,为price添加了新的solr排序 INSERT_UPDATE FieldSolrSort;sort(indexedType(identifier),code)[unique=true];fieldName[unique=true];descending[unique=true];$IndexedType:price;priceValue;true 我目前有两个solr排序 名称升序 姓名递减 我为价格添加了新的solr排序 涨价 降价 但我希望新的solr排序仅在用户登录时显示

我修改了代码,为price添加了新的solr排序

INSERT_UPDATE FieldSolrSort;sort(indexedType(identifier),code)[unique=true];fieldName[unique=true];descending[unique=true];$IndexedType:price;priceValue;true
我目前有两个solr排序

名称升序 姓名递减 我为价格添加了新的solr排序

涨价 降价 但我希望新的solr排序仅在用户登录时显示。有人知道吗?谢谢

步骤1:导入impex以启用价格排序选项 如果您参考任何OOTB storeapparelstore,您可以在Impex中看到价格排序价格asc选项。我在下面强调了弹劾

步骤2:对匿名用户隐藏 对于匿名用户,不要进行价格排序。您可以使用JSTL条件来检查,正如我在下面提到的

请注意:下面的代码仅供参考,我还没有测试过

orderFormPagination.tag 定义可用的排序

INSERT_UPDATE SolrSort ; &sortRefID ; indexedType(identifier)[unique=true] ; code[unique=true] ; useBoost  
                       ; sortRef3   ; $solrIndexedType                     ; name-asc          ; false   
                       ; sortRef4   ; $solrIndexedType                     ; name-desc         ; false   
                       ; sortRef5   ; $solrIndexedType                     ; price-asc         ; false   
                       ; sortRef6   ; $solrIndexedType                     ; price-desc        ; false   
定义排序字段

INSERT_UPDATE SolrSortField ; sort(indexedType(identifier),code)[unique=true] ; fieldName[unique=true] ; ascending[unique=true]                
                            ; $solrIndexedType:name-asc                       ; name                   ; true                  
                            ; $solrIndexedType:name-desc                      ; name                   ; false                 
                            ; $solrIndexedType:price-asc                      ; priceValue             ; true                  
                            ; $solrIndexedType:price-desc                     ; priceValue             ; false                 
索引类型产品中的更新排序选项

INSERT_UPDATE SolrIndexedType ; identifier[unique=true] ; type(code) ; variant ; sorts(&sortRefID)                                    
                              ; $solrIndexedType        ; Product    ; false   ; sortRef3,sortRef4,sortRef5,sortRef6
发现
如果你想知道我已经用正确的函数添加了新的solr排序,现在我想只有登录用户才能看到新添加的solr排序。thanksDon没有通过在JSP/tag中设置条件来呈现价格选项。查看我更新的帖子。即使这样,如果匿名用户知道URL,也不会让他们按价格排序,因为我们只是在UI中隐藏它。您需要在服务器端处理它以限制它。如果是匿名用户,则.tag文件中的代码是否仅隐藏价格排序选项?是的,您可以看到条件!isLoggedInUser&!fn:startsWithsort.code,“价格”
INSERT_UPDATE SolrSortField ; sort(indexedType(identifier),code)[unique=true] ; fieldName[unique=true] ; ascending[unique=true]                
                            ; $solrIndexedType:name-asc                       ; name                   ; true                  
                            ; $solrIndexedType:name-desc                      ; name                   ; false                 
                            ; $solrIndexedType:price-asc                      ; priceValue             ; true                  
                            ; $solrIndexedType:price-desc                     ; priceValue             ; false                 
INSERT_UPDATE SolrIndexedType ; identifier[unique=true] ; type(code) ; variant ; sorts(&sortRefID)                                    
                              ; $solrIndexedType        ; Product    ; false   ; sortRef3,sortRef4,sortRef5,sortRef6