To increase the number of titles returned to the borrower from a search on the title table of the FmLib database the CML/LitCrit application now implements the INFLECTIONAL condition of the full-text CONTAINS search. When the borrower enters only one keyword on the Library Search page the INFLECTIONAL condition is invoked and the search — it can be a search on title, author, or subject — is expanded to include variations of the word being searched on.
After the borrower types search criteria (strSearch) into the text box on the Library Search page and clicks Search the Search component in CML.dll is instantiated and code in the SearchString property runs.
Set oSearch = Server.CreateObject("CML.Search")
oSearch.SearchString = strSearch
oSearch.ConnectionString = Application("FmLib_ConnectionString")
oSearch.ConnectionTimeout = Application("ConnectionTimeout")
The following code fragment shows the statements that were added to the SearchString property to support the INFLECTIONAL condition of the CONTAINS search.
If SearchType = ftsInflection And _
UBound(m_aWords) = 1 And _
InStr(strncat, "*") = 0 Then
strncat = "FORMSOF (INFLECTIONAL,""" & strncat & """)"
End If
Two circumstances must be true to include the INFLECTIONAL condition in the query string. The SearchType must be ftsInflection and there can only be one keyword. The following line in the Search.asp script sets the SearchType (a public variable declared in the Search component) to ftsInflection. The code from the SearchString property can be viewed in Search.cls.
oSearch.SearchType = ftsInflection
The following table lists the forms on which the CML/LitCrit application implements full-text search, whether the INFLECTIONAL condition is applied, and what the default operator is when two search words are separated by spaces.
Form name | INFLECTIONAL | Logical operator | Number of keywords |
---|---|---|---|
Choose Title dialog box | No | N/A | 1 |
Choose Title dialog box | No | OR | 1+ |
Library Search Web page | Yes | N/A | 1 |
Library Search Web page | No | AND | 1+ |