Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 full-text indexing

Author  Topic 

kbrady
Starting Member

5 Posts

Posted - 2001-03-05 : 12:37:05
I have enabled full-Text Indexing service on one of my tables in my database in SQL Server 7.0 I have created code to the following:

<%
Dim rsFAQ_SEARCH__keywords
rsFAQ_SEARCH__keywords = "%"
if (Request.Form("FAQ_KEYWORDS") <> "") then rsFAQ_SEARCH__keywords = Request.Form("FAQ_KEYWORDS")
' Original script: keywords = trim(Request.Form("FAQ_KEYWORDS"))
%>
<%
Dim rsFAQ_SEARCH__category
rsFAQ_SEARCH__category = "2"
if (Request.Form("FAQ_CATEGORY_ID") <> "") then rsFAQ_SEARCH__category = Request.Form("FAQ_CATEGORY_ID")
' Original script: category = (Request.Form("FAQ_CATEGORY_ID"))
%>
<%
set rsFAQ_SEARCH = Server.CreateObject("ADODB.Recordset")
rsFAQ_SEARCH.ActiveConnection = MM_garlock_STRING
rsFAQ_SEARCH.Source = "SELECT * FROM FAQ WHERE FAQ_CATEGORY_ID = '" & rsFAQ_SEARCH__category & "' AND FREETEXT (FAQ_KEYWORDS,'%" & rsFAQ_SEARCH__keywords & "%')"
rsFAQ_SEARCH.CursorType = 0
rsFAQ_SEARCH.CursorLocation = 2
rsFAQ_SEARCH.LockType = 3
rsFAQ_SEARCH.Open()
rsFAQ_SEARCH_numRows = 0
%>

The problem that I have been having is that on the form page previous to this I have the user complete one or two of the form objects. The 1st FAQ_CATEGORY_ID is a pull down passing a Unique Category ID hence I want this form object to be required. The 2nd form object FAQ_KEYWORDS is optional where they can input several words to refine there search.

The problem exists when the user only selects the 1st FAQ_CATEGORY_ID form object and does not complete the 2nd FAQ_KEYWORDS form object. This is crucial because If the user wants to see all the related records according to FAQ_CATEGORY_ID they should be able to. Again the FAQ_KEYWORDS object should only be optional.
Here is the error I have been receiving:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]The query contained only ignored words.
/garlock/internet/faq_results2.asp, line 26

If any one has worked with full-text indexing and has found a way around this please help. Thanks
   

- Advertisement -