View Search ( Notes error: Query is not understand

2019-07-11 07:52发布

问题:

I am trying to create a Xpage view search in application, for the below query alone I am getting an error "Notes error: Query is not understandablecode"

Code:
var strQuery="Field cc_number=\"DADM20121012174051\"";
return strQuery;

For other Queries I have created, the search is working fine.
can any one tell me why this error is coming.I read in web the size limit of search query is 1024 bytes.Link:http://www-01.ibm.com/support/docview.wss?uid=swg1LO68462. I think the above Query is not exeeds the 1024bytes..

回答1:

That does not give me an error in client but in my understanding the syntax is:

FIELD cc_number CONTAINS DADM20121012174051

OR

[cc_number]=DADM20121012174051

Give those a try.



回答2:

With most full text search issues, I recommend to first test in the Notes client to see what results you get back.

In this case you want to try.

Field cc_number="DADM20121012174051"

Doe's that work? If it doesn't then it could be related to the UNK table, see the following question.

After that put on the following debug to your notes.ini on the server.

CONSOLE_LOG_ENABLED=1
Debug_FTV_Search=1
DEBUG_THREADID=1

When you do a search now, it will generate debug for that search, and save it in a console.log file under the IBM_TECHNICAL_SUPPORT folder. Add the debug output to your question above and I can comment on it (remove anything confidential that may show up).



回答3:

@Simons way is the right one, in the case of a longer query, you might replace the Field cc_number be the square brackets, so that it becomes [cc_number] and completes to a query like this [cc_number]="DADM20121012174051" One more thing that might lead to the error you see: is there any document in the database or view that stores a numeric instead of a string value in the cc_number item? If that's the case the FTSearch might get confused by your directive to search for a string and finding a candidate that holds a number value and then cries for help by throwing an error. I'm suggesting only to iron out if that's possibly the case here...