This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 13, 2011, 10:20 AM
26 Posts
topic has been resolvedResolved

XPage View Search on specified Dates

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: search,view panel
  • Replies: 6
 Hi All,
 
I am trying to implement the search functionality in a view panel. The search creteria is entered in Edit Textboxes binded to SessionScope variables. Than the search query string is constructed in the data -> data -> search attribute in the all properties tab for the view panel.  
 
The search functionality requires to search for all the documents specified between start date and end date. The user enters this date in the DojoDateControl of the extension library. The date is formatted in "dd/mm/yyyy" and the same is format stored in the createdDate field in the notes document. On passing this query string to the view panel, I receive a XPage error specifying "Query is not understandable"
 
Any ideas and suggestions are appreciated. 
 
Thanks for your time. 
 
Regards, 
Yusuf 
Mar 13, 2011, 1:28 PM
261 Posts
Re: XPage View Search on specified Dates
If I'm correct, the "search" property should evaluate to a valid full-text query (e.g. "[form]=contact" ). See here: http://www-10.lotus.com/ldd/dominowiki.nsf/dx/full-text-syntax for some syntax guidelines.
 
To check if your resulting query is a valid one, you might try to perform a search on the view in the Notes client.
Mar 14, 2011, 5:39 AM
26 Posts
Re: XPage View Search on specified Dates
 Hi Mark,
 
Thanks for your reply. I will try to explain my requirement more clearly. I had a normal view in a web app on which  I used to do ?SearchView query and pass the search cretiria as query to the view. The query was something like {FIELD createdDate >= "14/03/2011"} with the date in dd/MM/yyyy format. This was working fine. Going forward, we started migrating design elements to XPage and this Search XPage was created with a view panel in it with the data. In the search cretiria, I generate and pass the query as explained in Tutorial: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesViewControlAddFullTextSearch.htm
 
Following this tutorial, I tried to get the expected output but it results in an error. Am I doing something incorrect or missing something? 
 
Thanks for your time again. 
 
Regards, 
Yusuf 
Mar 14, 2011, 8:29 AM
261 Posts
Re: XPage View Search on specified Dates
Hi Yusuf,
 
First of all, assuming that createdDate is a date/time field, the date in the query should be entered without quotes, e.g.

FIELD createdDate < 10/3/2011
 
Your problem might be related to the UNK table (an internal table of all the fields in a database, see http://www-01.ibm.com/support/docview.wss?uid=swg21100238). I had some issues with FT searching in date fields in the past.

If I'm correct, fields (including the field type) are added to that table when the first document is created in a database containing that field. If that document has the date field on it but it has en empty value (""), the field is added as a text field to the UNK table and you won't be able to perform FT searches on it using date values. You can workaround this by never setting an empty string in a date field as a value, although this won't solve the problem for existing databases. The UNK table will probably be re-created on a database copy, but you'll have to test that.
 
Mark
Mar 14, 2011, 8:30 AM
261 Posts
Re: XPage View Search on specified Dates
FYI: the article I referenced also states that a "copy-style compact" wil recreate the UNK table.
Apr 13, 2011, 4:42 PM
26 Posts
Re: XPage View Search on specified Dates
 Hi Mark,
 
Sorry for a extremely late reply. Just wanted to thank you for your guidance. I was encapsulating the dates with double quotes and that was the cause of the error. 
 
Thanks again and sorry for late reply. 
Regards, 
Yusuf 
Sep 7, 2011, 7:31 PM
35 Posts
Re: XPage View Search on specified Dates
Hi! Can you paste your working code? I am having the same issue.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal