对我的文档库进行高级搜索,其中搜索包括以下类型的字段;自由文本,下拉式&人员或组字段 [英] Build an advance search for my document library, where the search include fields with the following types; free text,drop-down & people or group fields

查看:65
本文介绍了对我的文档库进行高级搜索,其中搜索包括以下类型的字段;自由文本,下拉式&人员或组字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在内部部署SharePoint Server 2013服务器场中工作.而且我有一个包含以下内置列的文档库:-

I am working on an on-premises sharepoint enterprise 2013 farm. and i have a document library with the following built-in columns:-

  1. 标题
  2. 名称
  3. 创建
  4. 修改
  5. 创建者
  6. 修改者

我还添加了以下自定义网站列:-

also i have added these custom site columns:-

  1. 说明.多行文字
  2. 发布日期.日期和时间
  3. 类型.下拉菜单

现在我的客户提出了一个要求,他们希望在列表视图上方有一个高级搜索按钮,他们可以在其中搜索以上字段.

now i got a requirement from our customer that they want to have an advance search buttons above the list view where they can search the above fields.

现在我尝试了这两种方法,但没有一个能按我的意愿100%工作.

now i tried these 2 appraochies , but none of them worked 100% as i wanted.

方法A..我启用了元数据导航和过滤网站功能.但是此方法中的问题在于,搜索中只能覆盖某些字段类型.其中具有单行文本或多行文本的字段 的文本类型无法搜索或过滤.

Approach A. i enable the Metadata Navigation and Filtering site feature. but the problem in this appraoch that only certain fields types can be covered in the search. where fields with single line of text or multiple line of text types can not be searched or filtered.

方法B.我在网络上搜索了一些第三方工具,然后找到了这个工具 https://splistviewfilter.codeplex.com/这似乎为配置我想要的字段提供了一种简便的方法搜索.但是经过一番测试,我意识到它遇到了一个重大问题. 是该Web部件将仅搜索当前目录中的文档.因此,如果我有文件夹和子文件夹,则此Web部件将无法按预期工作.

Approach B. i search the web for some third party tools and i find this one https://splistviewfilter.codeplex.com/ which seems provide an easy way to configure the fields i want to search. but after some testing i realize that it suffers from a major problem; is that this web part will only search documents inside the current directory. so if i have folders and sub folders this web part will not work as expected.

因此,我不确定如何为客户实施要求.我脑子里有这个方法,但是不确定如何实现.现在,据我所知,如果我正确建立一个URL,我可以相应地过滤/搜索列表视图.例如,如果我指定 在我想要具有name ="123" & type="General" & so on的文档的URL内,然后可以在内容编辑器Web部件内添加表示上述站点列的字段,并添加一个搜索按钮.在哪里 搜索按钮将使用搜索参数构建预期的网址,并相应地调用列表视图...这是否是遵循的有效方法?

So I am not sure how i can implement the requirement for our customer. i have this appraoch in my mind, but not sure how i can implement it. now as i know if i build a url correctly i can filter/search the list view accordingly. for example if I specify inside the url that i want the documents which have name ="123" & type="General" & so on... then i can add fields inside a content editor web part which represents the above site columns, and a search button. where the search button will build the intended url with the search parameters, and call the list view accordingly... so is this a valid appraoch to follow?

推荐答案

我们可以使用HTML + jQuery + REST API来实现它,这是一个简单的示例供您参考,添加更多代码以使其符合您的要求.

We can use HTML+jQuery+REST API to achieve it, here is a simple example for your reference, add more code to make it works for your requirement.

<script src="//code.jquery.com/jquery-3.2.1.min.js" type="text/javascript"></script>
<script type="text/javascript">


(function(){
(function () {


(#SearchBtn").click(功能(){ if(
("#SearchBtn").click(function(){ if(


这篇关于对我的文档库进行高级搜索,其中搜索包括以下类型的字段;自由文本,下拉式&amp;人员或组字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆