有没有一种方法可以控制用户搜索界面中的排序顺序?

编程入门 行业动态 更新时间:2024-10-23 13:37:56
本文介绍了有没有一种方法可以控制用户搜索界面中的排序顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为共享层开发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:

但是在生产服务器上,我得到以下信息:

But on the production server I get the following:

我曾尝试做的事情:

  • 从 webapps 删除 alfresco 和 share 目录;
  • 清除浏览器的缓存;
  • 从共享中卸载AMP,然后重新安装。检查它是否存在于共享中;
  • 使用Solr执行完全重新索引
  • 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

没有任何帮助。所有这些都无助于覆盖 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.

更多推荐

有没有一种方法可以控制用户搜索界面中的排序顺序?

本文发布于:2023-10-26 23:26:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531653.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:顺序   界面   方法   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!