notesdocumentcollection.ftsearch和带有特殊字符的搜索查询 [英] notesdocumentcollection.ftsearch and a search query with special characters

查看:228
本文介绍了notesdocumentcollection.ftsearch和带有特殊字符的搜索查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在看起来像这样的ssjs中创建搜索功能.

i try to make a search function in ssjs that looks like this.

notesdocumentcollection.ftsearch('"*' + searchword + '*"');

我有一个文档,其字段值为"Dr. Max Muster". 如果我搜索博士",我得到一个结果. 如果我搜索博士最大",我不会得到结果. 如果我删除通配符并输入"dr.max",我将得到结果.

i have a document with this field value "Dr. Max Muster". if i search for "dr" i get a result. if i search for "dr. max" i don't get a result. if i remove the wildcard and type "dr. max" i will get an result.

我也这样尝试过

notesdocumentcollection.ftsearch('*' + searchword + '*');

有什么方法可以在搜索查询中获得带有通配符和特殊字符的结果吗?

Is there any way to get an result with wildcards and special characters in the search query ?

P.S. 如果我在视图中的notesclient中尝试此操作,它将起作用.

P.S. If i try this in the notesclient in the view it will work.

对于此查询"dr.ma",我从服务器获得了此调试结果

for this query "dr. ma" i got this debug results from the server

IN FTGSearch option = 0x400089 
[12CC:000A-1A30] Query: dr. ma 
[12CC:000A-1A30] Engine Query: ("drma") 
[12CC:000A-1A30] OUT FTGSearch error = F22 
[12CC:000A-1A30] FTGSearch: found=0, returne 
[12CC:000A-1A30] IN FTGSearch option = 0x40008C 
[12CC:000A-1A30] Query: *"dr**ma"* 
[12CC:000A-1A30] Engine Query: ("*dr**ma*") 
[12CC:000A-1A30] OUT FTGSearch error = F22 
[12CC:000A-1A30] FTGSearch: found=0, returned=0, start=0, count=0, limit=0

推荐答案

确定首先,搜索引擎使用

OK first up the search engine uses a trigram system. So searching for 2 characters will not work as expected. The wild cards may be helping but there is no guarantee it will get everything.

据我了解,如果您在Notes客户端的全文搜索"栏中手动输入以下内容,它会起作用吗? (包括引号)

So as I understand the next part if you manually type in the following into the Full Text Search bar in the notes client and it works? (quotes included)

"*dr. max*"

在Notes客户端中要注意的一件事是,您可以激活两种不同的搜索方式(切换基本首选项). Web查询和Notes查询.

One thing to be aware of in the Notes client is that you can activate two different search modes (switch in basic preferences). Web query and Notes query.

默认情况下,Web查询处于打开状态(IIRC),因此您可以像使用标准Internet搜索引擎一样进行搜索.

By default web query is on (IIRC), so you search as if you would your standard internet search engines.

如果已将其切换到Notes查询,或者搜索以全大写字母开头,则使用Notes先前使用的语法.

If you have switched it to Notes query, or the search starts with an all capitals word it use the syntax that Notes has used previously.

因此,您可能会因此而看到客户端与XPages之间的差异.

So it possible you are are seeing differences in the client vs XPages due to that.

要对此进行测试,可以按如下所示进行调试.在Domino服务器控制台上,键入以下内容.

To test this you can debug as follows. On the Domino server console type the following.

set config DEBUG_THREADID=1
set config CONSOLE_LOG_ENABLED=1
set config Debug_FTV_Search=1

现在在Notes客户端和XPage中进行搜索.它将在Domino Console上生成类似以下内容的内容(注意:我在重要行的开头添加了数字).

Now do a search in the notes client and the XPage. It will generate something like the following on the Domino Console (note: I added the numbers at the start for the important lines).

IN FTGSearch
[07FC:0048-0A94] option = 0x400219
1. [07FC:0048-0A94] Query: ("*test*")
2. [07FC:0048-0A94] Engine Query: ("*test*"%STEM)
3. [07FC:0048-0A94] GTR query performed in 6 ms. 5 documents found
4. [07FC:0048-0A94] 0 documents disualified by deletion
5. [07FC:0048-0A94] 0 documents disqualified by ACL
6. [07FC:0048-0A94] 0 documents disqualified by IDTable
7. [07FC:0048-0A94] 0 documents disqualified by NIF
8. [07FC:0048-0A94] Results marshalled in 3 ms. 5 documents left
9. [07FC:0048-0A94]  OUT FTGSearch error = 0
[07FC:0048-0A94] FTGSearch: found=5, returned=5, start=0, count=0, limit=0
[07FC:0048-0A94] Total search time 10 ms.

每个位的解释.

  1. 您发送到搜索引擎的字符串.在这种情况下,它是测试"(带引号)
  2. 已编译的搜索字符串.
  3. 花费了多长时间以及找到的文档总数.
  4. 总计已丢弃,因为已将其标记为已删除.
  5. 总计已丢弃,因为您无权查看它们.
  6. 由于IDTable结果而被丢弃的总数.
  7. 总计已丢弃,因为它们不会出现在您正在搜索的视图中.
  8. 花费的时间和剩余的文件.
  9. 如果发生任何错误.

因此,如果不清楚为什么提到这两个搜索结果无效,请生成这两个搜索结果并将其发布.

So generate those two search results and post them if it is not obvious why it mentioned it didn't work.

这篇关于notesdocumentcollection.ftsearch和带有特殊字符的搜索查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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