The Problem with Quick Find

I have been working on a new product which will hopefully be released soon. In this new product the user needs to be able to look up a constituent in as few key strokes as possible. The approach that I took was to use the same functionality as the Quick Find mechanism that you see on the records page in The Raiser’s Edge. This is dependant on your user settings so that you can either put in a constituent id, the first name followed by the surname or the surname comma the first name. While I was testing it on the sample database it worked perfectly. However when I tested it on a client’s very large database there were issues.In order to look up using the Quick Find mechanism we use the following code:

 Dim reserv As REServices
 Dim finder As IBBRecordFinder = Nothing
 Dim result As Integer = -1
 Dim enteredValue As String = "123"
'Instantiates a copy of the REServices object
 reserv = GetREServices  

 Try

    finder = reserv.CreateServiceObject(bbServiceObjects.bbsoRecordFinder)
    finder.Init(SessionContext)

    finder.DataEntryFormatType = bbDataEntryFormatType.dataentry_CONSTITUENT

    finder.PromptIfNoMatch = True
    finder.ForceSearchForSingleRecord = False
    finder.IncludeNonConstituent = False

    If finder.Search(enteredValue) = True Then
       result = finder.RecordId
    End If
 Catch ex As Exception
   'Process Exception here
 Finally
   'Close down and tidy IBBRecordFinder and REServices objects nicely here
 End Try

The code is not very complicated and ought to be self explanatory. In reality the enteredValue variable would come from a text box or equivalent. In the case above the value is a constituent id. The finder object is used to search. If no match is made or duplicates are found then the standard RE search screen is shown.

As said, this worked fine when working on my sample database however when working on a very large database I was forced to change this to a simple LoadByField on a constituent record. Working with this method the user would be forced to enter a constituent id. However the speed at which the look up took place increased dramatically. Using the Quick Find mechanism above (or indeed within the Raiser’s Edge application itself) looking up a constituent record took over 15 minutes whereas using this method the result was almost instantaneous.