Ftsearch

[@Texttonumber([RegionNumber]]>=30

I am using view ftsearch in lotus script my regionnumber field is text but I want to compare like above

It says the text field is not comparable if I use > or < but for = it accepts

I can create computed hidden field and make it as number and use the regionnumber has new computed field value and save the document then my problem will be solved

i have morethan 50000 documents and i dont want to save existing document any idea how to solve it

thanks

soma

Subject: More details?

Well, you can’t perform a greater than/less than comparison on strings, that is why you should always think through the field types before you start designing. However, 50,000+ documents is not hard to modify, you can use either NoteMan or Ytria scanEZ to do that in a few minutes. At least one (preferably both) should be in your toolbox anyway…

But if you don’t want to do that, describe the agent where you are doing the db.FTSearch call. Is it being run by users or schedule on server? How often is it run? How many documents are expected to be returned?

There are several other ways to perform a similar search/lookup. FTsearch is (normally) limited to returning 5000 documents, so writing the code in a different way could return more if that is needed.

Here is one approach:

Create a hidden view, with two columns.

SELECT Form=“yourformname”

The first column contains the formula @TextToNumber(RegionNumber) and is sorted descending.

The second column contains @Text(@DocumentUniqueID)

Your code would then look something like this (only relevant code included, not tested):

Dim view As NotesView

Dim col As NotesViewEntryCollection

Dim entry As NotesViewEntryset

Dim mydoc List As Integer

view = db.GetView(“(HiddenLookupView)”)

set col = view.AllEntries

set entry = col.GetFirstEntry

Do While Not entry Is Nothing

If IsNumeric(entry.ColumnValues(0)) Then

If Cint(entry.ColumnValues(0))>=30 Then

mydoc(entry.ColumnValues(1)) = Cint(entry.ColumnValues(0))

End If

End if

set entry = col.GetNextEntry(entry)

Loop

You now have a list of documents where the region number is 30 or greater. The listtag is the UNID of the document (which makes for easy access to it if you need) and the list item value is the region code.

That is how I would have done it.