Need formula help with java search() method

I’m using the NCSO.jar with Domino 6 to try to get a DocumentCollection using the Database search( String formula ) method.

I’m an extreme newbie to @function formulas and cannot seem to figure out how to properly write a formula for this method to do this pseudo-code:

return all documents where:

field LastName starts with case insensitive String "Sm" and

field FirstName starts with case insensitive String "Bo"

This was my first incorrect stab:

DocumentCollection docs = db.search( “@Begins( LastName; "Sm" ) & @Begins( FirstName; "Bo" )” );

Any thoughts would be greatly appreciated.

Cheers.

Steve Maring

PwC

Tampa, FL

Subject: need formula help with java search() method

Hallo colleague in Tampa!

What exactly isn’t happening for you? Is the formula not computing as intended, or is the Java returning an error?

Bear in mind that @Begins is case sensitive, so you may need to “normalise” the text first using something like this:

@Begins(@LowerCase(LastName); “sm”) & @Begins(@LowerCase(FirstName); “bo”)

If the error is occurring elsewhere, or you’re not convinced that your formula is right, try creating a view in the database, with your code as its selection criteria.

Once you’ve satisfied yourself that the @formula is working as you want it to, then move it into your Java. Works for me!

HTH

Ben