xpages 部分 - 完整搜索 [英] xpages partial - full search
问题描述
我看到了来自 IBM 的一个很棒的教程,其中解释了如何在视图面板中创建搜索模.
I saw a great tutorial from IBM explaining creating a search modulo into a view panel.
我调整的视图面板中的代码( search
属性):
The code from the viewpanel ( search
property ) I adjusted:
"(Field txt_autor = \"" + sessionScope.searchAutor + "\")";
}
我是否可以修改代码,以便它也提供部分字符串匹配的搜索结果,例如:如果 Autor = Smith
和字符串 searchAutor = Smit
目前我得到 0 个文件/0 个结果.如果可能的话,像 CONTAINS
这样的东西会很有用.
Is there any chance I can modify the code so that it offers the search results for the partial string matches also, for example: if Autor = Smith
and in the string searchAutor = Smit
currently I get 0 documents / 0 results. Something like CONTAINS
will be useful, if it's possible.
感谢您的时间.
推荐答案
在每个搜索字符串的前面和末尾添加一个星号*",例如 "*Smit*"
.
Add a star "*" in front and at the end of every search string like "*Smit*"
.
你的代码看起来像这样
tmpArray[cTerms++]= "(Field txt_titlu = \"*" + sessionScope.searchTitle + "*\")";
这篇关于xpages 部分 - 完整搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!