John
John

Reputation: 157

XPages Exact Search

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?

Upvotes: 1

Views: 630

Answers (2)

W_K
W_K

Reputation: 868

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.

Upvotes: 1

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

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 + "\""

Upvotes: 0

Related Questions