user1274898
user1274898

Reputation:

FT searching in a view pannel

I am try to create a search string to add the view pannel search property. I need to be able to search between 2 dates ( from date and to date). The syntax that works is date equal to e.g. (FIELD Form ="form") AND (FIELD dateCompleted = 01/01/2012) works OK. The dates are inputed into 2 input controls using a date picker or entered manually. If the try (FIELD Form ="Form") AND (FIELD dateCompleted => 01/01/2012) AND (FIELD dateCompleted <= 31/01/2012) to search between the 2 dates, I get an error, or seach return no documents found. There are documents (dateCompleted is date/time field), so should return dococuments. Any idea what the correct syntax should be?

Upvotes: 0

Views: 189

Answers (3)

Mark Leusink
Mark Leusink

Reputation: 3757

Your syntax appears to be fine (although => should probably be >= ). The problem with not being able to search between dates might be caused by an incorrect data type for your dateCompleted field in the database's UNK table. The UNK table lists all fields in a database and their datatypes and is used by the FT search. If the field isn't defined as a date field, a "between dates"-fulltext search won't work. AFAIK the first occurrence of a field creates the entry in the UNK table: so if that's an empty field it will think it's a text field.

More information about the UNK table can be read here. IBM also offers a tool to view the UNK table. The UNK table is recreated if you issue an compact -c on the database.

Upvotes: 0

Frantisek Kossuth
Frantisek Kossuth

Reputation: 3524

Dates and numbers may be pretty troublesome sometimes with FT - it is full "TEXT" anyway. In your case, try to switch month and day - 01/31/2012 - this can be very sensitive according to various seting at OS and Domino level.

Upvotes: 2

Ferry Kranenburg
Ferry Kranenburg

Reputation: 2635

Try this:

(FIELD Form ="form") AND ((FIELD dateCompleted => 01/01/2012) AND (FIELD dateCompleted <= 31/01/2012))

Upvotes: 2

Related Questions