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


Feb 2, 2016, 5:16 PM
21 Posts

Help with db.search with lotus script

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer,End User
  • Tags:
  • Replies: 4

I'm doing a 
searchFormula ={ Form = "Memo" & @Contains(Body ; "Normal Engineering work hours")}
Set searchCollection = searchDB.Search( searchFormula, Nothing, 0 )

but it returns 0 documents to the collection, but I know the string is in the database.

it must be the format of the search formula, can anyone help?

I've tried { form = "memo" AND FIELD [ BODY] Contains "Normal" ) also with no results...
actual setup:

​/Excerpt of code that matters....

Dim searchCollection as NotesDocumentCollection

dim string_searchText as string
​dim searchFormula  as string
​string_SearchText = uidoc.GetFieldText("searchtext")

searchformula = | {Form='Memo' AND FIELD [Body] CONTAINS '| & string_searchText & |'}|
Set searchCollection = searchDB.Search( searchFormula, Nothing, 0 )

Nothing get returned...

 

Feb 2, 2016, 8:59 PM
82 Posts
some info
If the database is full text indexed, try something like this:

Dim session As New NotesSession,db As NotesDatabase,coll As NotesDocumentCollection
Dim query As String, anyString As string
Set db = session.Currentdatabase
anyString = "lwp"
query = |[Form] = "Memo" and [Body]{| + anyString + |}|
Set coll = db.Ftsearch(query, 0)
Print "the number of docs is: " + CStr(coll.count)

If the database is NOT full text indexed, I think the problem you are having is that Body is a RichText field and the query selection does not like rich text.  Simply try create a view with:
Select Form = "Memo" & @Contains(Body ; "Normal Engineering work hours")
Does it return docs?  If not, it gets a little more complicated.  Let me know.
Feb 3, 2016, 2:26 PM
323 Posts
If you can do what Bob says, great! That's way faster. If not ...

... take a look at @Abstract([TEXTONLY]; 64994; ""; "Body") to retrieve some of the Body field.

Also, you may want @Uppercase() if the string check shouldn't be case sensitive.

Feb 4, 2016, 7:45 PM
21 Posts
thanks

Thank you gentlemen.. I'll give a go in a few hours...

Feb 12, 2016, 6:34 PM
21 Posts
This worked

Bob,

This worked fine.

 

thank you


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