Is there a way to control the sorting order in the user's search interface?

天大地大妈咪最大 提交于 2019-12-08 12:18:42

问题


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.

In people-finder.js I found this line:

...
/**
* 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;
}
...

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.

How can I do it?


As Sanjay Patel noted, I created the following path and place relevant JavaScript files there:

share\src\main\amp\res\components\people-finder

I tried this way too - share\src\main\amp\web\components\people-finder\

But now on the embedded local Tomcat all works fine and I can see that JavaScript file was overridden:

But on the production server I get the following:

What I was tried to do:

  • delete alfresco and share directories from webapps;
  • clear the browser's cache;
  • uninstall AMP from Share and install again. Check, that it present in Share;
  • perform a full reindex with Solr

Nothing helps.. All of that not helped to override the people-finder.js

What could be the reason?


回答1:


Create same path as people-finder.js file in eclips like share\src\main\amp\web\components\people-finder\ and place your modified file.



来源:https://stackoverflow.com/questions/41999418/is-there-a-way-to-control-the-sorting-order-in-the-users-search-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!