有没有一种方法可以控制用户搜索界面中的排序顺序? [英] Is there a way to control the sorting order in the user's search interface?
问题描述
我正在为共享层开发AMP文件,并且我想覆盖搜索顺序。当前,排序由 fullName
执行。就我而言,我需要按 lastName
排序。
I'm developing AMP file for the Share tier and I want to override the search order. Currently, the sorting performed by fullName
. In my case I need sorting by lastName
.
在 people-finder.js
我找到这行:
...
/**
* Build URI parameter string for People Finder JSON data webscript
*
* @method _buildSearchParams
* @param searchTerm {string} Search terms to query
*/
_buildSearchParams: function PeopleFinder__buildSearchParams(searchTerm)
{
return "sortBy=fullName&dir=asc&filter=" + encodeURIComponent(searchTerm) + "&maxResults=" + this.options.maxSearchResults;
}
...
我认为我应该覆盖 sortBy
参数从 fullName
到 lastName
。我在本地进行了一些实验,发现这些值的变化会影响排序。
I think, that I should override sortBy
parameter from fullName
to lastName
. I have done some experiments locally and saw that changes in those values make affect to the sorting.
我该怎么做?
我创建了以下路径,并将相关的JavaScript文件放置在其中:
As Sanjay Patel noted, I created the following path and place relevant JavaScript files there:
share\src\main\amp\res\components\people-finder
我也尝试过这种方法- share\src\main\amp\web\components\people-finder\
I tried this way too - share\src\main\amp\web\components\people-finder\
但是现在在嵌入式本地Tomcat上一切正常,我可以看到JavaScript文件被覆盖了:
But now on the embedded local Tomcat all works fine and I can see that JavaScript file was overridden:
< a href = https://i.stack.imgur.com/nfJT4.png rel = nofollow noreferrer>
但是在生产服务器上,我得到以下信息:
But on the production server I get the following:
我曾尝试做的事情:
- 从
webapps
删除alfresco
和share
目录; - 清除浏览器的缓存;
- 从共享中卸载AMP,然后重新安装。检查它是否存在于共享中;
- 使用Solr执行完全重新索引
- delete
alfresco
andshare
directories fromwebapps
; - clear the browser's cache;
- uninstall AMP from Share and install again. Check, that it present in Share;
- perform a full reindex with Solr
没有任何帮助。所有这些都无助于覆盖 people-finder.js
Nothing helps.. All of that not helped to override the people-finder.js
可能是什么原因?
推荐答案
在诸如share\src\main\amp\web\components\people-finder\之类的日食中创建与people-finder.js文件相同的路径,并将修改后的文件。
Create same path as people-finder.js file in eclips like share\src\main\amp\web\components\people-finder\ and place your modified file.
这篇关于有没有一种方法可以控制用户搜索界面中的排序顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!