1

I am getting the error : "Relational operators are not supported in text fields" when I am doing db.FTSearch(FIELD examplefield >= 02/25/2013). Here field name is "examplefield" & field type is datetime

Can any one help for fixing this issue?

  • 3
    This should answer it. http://stackoverflow.com/questions/9151448/lotus-domino-after-changing-type-of-a-field-full-text-search-wont-work-for-th/9151751#9151751 – Simon O'Doherty Feb 27 '13 at 20:32

2 Answers2

1

As described in the question that Simon linked to, the UNK table in a database will determine the data type that is used for a field when doing full text searches. The data type you have set for that field on any particular form does not matter - the field in the UNK table is defined by actual data on documents, and does not automatically re-calculate itself. So, you first want to ensure that "examplefield" in every document in which it exists has a datatype for date-time. But then, you would also need to re-build the UNK table. There are 2 ways - that I know of - to do this:

  1. Drop the full-text index on the database, compact the database, and then re-create the index.
  2. Create a new replica of the database and replace the existing database with the replica.

Also, you can check the datatype for a field in the UNK table using the freeware NotesPeek tool - which you can download from here: http://www-01.ibm.com/support/docview.wss?uid=swg24005686

Ed Schembor
  • 8,090
  • 8
  • 31
  • 37
0

In general, I wouldn't use FTSearch. I would create a hidden view with the first column sorted by examplefield as text with format yyyy-mm-dd. Then, you can use this:

set o_doc = o_hidden_view.GetDocumentByKey("2013-03-25") 
while not o_doc is nothing
    'Do something

    set o_doc = o_view.GetnextDocument(o_doc)
Wend

In my opinion, it has a better time response at expense of put the load in the server. As always, it depends what type data you want to handle.

Mario S
  • 1,914
  • 1
  • 19
  • 32