XPages Exact Search

╄→尐↘猪︶ㄣ 提交于 2019-12-24 13:33:55

问题


I am using a view control in an XPage, and have incorporated a search with much struggling.

I also have a dropdown to select a category, to be used as an additional filter with the search.

My query is now:

sessionScope.searchTerm AND Field Category=" + sessionScope.categoryname + "

Everything finally works except that the category filter is finding non-exact matches, for example "Management" finds the documents in the categories "Management" but also in "Facilities Management". This is not acceptable.

I tried setting searchExactMatch=true in the View properties, but this gives a stack trace, and in the log is the error: "GTR search error: Case sensitive parameter error.: Query is not understandable"

So I guess this parameter is for exact case matches instead of exact search term matches as is implied. Not what it says in the help, but OK I roll with the punches as usual.

If I use the "Filter by category name" the category filter works great with no search term, and the search seems to work OK except that the categoryFilter setting is now ignored.

This seems to be the common behavior, that these settings all work fine in isolation but never in combination. This is what I found for view keys as well.

I am now out of ideas, can anyone offer assistance?


回答1:


This is a bit hackery solution but You could have additional computed field categorySearch with additional content delimiters, for example You could add additional % characters: %Completed% and then Your search query would look like this:

sessionScope.searchTerm AND Field categorySearch=%" + sessionScope.categoryname + "%

I hate myself for proposing this kind of solution but if this work then maybe I will be forgiven.




回答2:


You have to search according to this article: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Searching_for_Documents#Full-text+Search

In your case do the following for the Category part:

"[Category] = \"" + sessionScope.categoryname + "\""


来源:https://stackoverflow.com/questions/16903013/xpages-exact-search

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