jettman26
asked on
Full-text search problem
I am using VS.NET 2005 and SQL Server 2005
I am getting an error running the following query.
SELECT [notes] FROM [Info] WHERE (CONTAINS([notes], @notes)) ORDER BY [info_date] DESC
The notes field is a varchar field with a length of 7000.
I have never created an index before. Maybe this is what I need to do? When I try to create a Full-Text Index it tells me 'Creation of the full-text index is not available. Database is not enabled to allow for full-text indexing.'
How do I enable it?
Any ideas?
Here is the error.
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Info' because it is not full-text indexed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE xception: Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Info' because it is not full-text indexed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Info' because it is not full-text indexed.]
System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection) +83
System.Data.SqlClient.TdsP arser.Thro wException AndWarning (TdsParser StateObjec t stateObj) +345
System.Data.SqlClient.TdsP arser.Run( RunBehavio r runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3152
System.Data.SqlClient.SqlD ataReader. ConsumeMet aData() +58
System.Data.SqlClient.SqlD ataReader. get_MetaDa ta() +127
System.Data.SqlClient.SqlC ommand.Fin ishExecute Reader(Sql DataReader ds, RunBehavior runBehavior, String resetOptionsString) +295
System.Data.SqlClient.SqlC ommand.Run ExecuteRea derTds(Com mandBehavi or cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1083
System.Data.SqlClient.SqlC ommand.Run ExecuteRea der(Comman dBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +337
System.Data.SqlClient.SqlC ommand.Run ExecuteRea der(Comman dBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +45
System.Data.SqlClient.SqlC ommand.Exe cuteReader (CommandBe havior behavior, String method) +163
System.Data.SqlClient.SqlC ommand.Exe cuteDbData Reader(Com mandBehavi or behavior) +35
System.Data.Common.DbComma nd.System. Data.IDbCo mmand.Exec uteReader( CommandBeh avior behavior) +32
System.Data.Common.DbDataA dapter.Fil lInternal( DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +183
System.Data.Common.DbDataA dapter.Fil l(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +308
System.Data.Common.DbDataA dapter.Fil l(DataSet dataSet, String srcTable) +153
System.Web.UI.WebControls. SqlDataSou rceView.Ex ecuteSelec t(DataSour ceSelectAr guments arguments) +3060
System.Web.UI.WebControls. BaseDataLi st.GetData () +54
System.Web.UI.WebControls. DataList.C reateContr olHierarch y(Boolean useDataSource) +381
System.Web.UI.WebControls. BaseDataLi st.OnDataB inding(Eve ntArgs e) +76
System.Web.UI.WebControls. BaseDataLi st.DataBin d() +85
System.Web.UI.WebControls. BaseDataLi st.EnsureD ataBound() +82
System.Web.UI.WebControls. BaseDataLi st.OnPreRe nder(Event Args e) +26
System.Web.UI.Control.PreR enderRecur siveIntern al() +148
System.Web.UI.Control.PreR enderRecur siveIntern al() +233
System.Web.UI.Control.PreR enderRecur siveIntern al() +233
System.Web.UI.Control.PreR enderRecur siveIntern al() +233
System.Web.UI.Control.PreR enderRecur siveIntern al() +233
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5036
I am getting an error running the following query.
SELECT [notes] FROM [Info] WHERE (CONTAINS([notes], @notes)) ORDER BY [info_date] DESC
The notes field is a varchar field with a length of 7000.
I have never created an index before. Maybe this is what I need to do? When I try to create a Full-Text Index it tells me 'Creation of the full-text index is not available. Database is not enabled to allow for full-text indexing.'
How do I enable it?
Any ideas?
Here is the error.
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Info' because it is not full-text indexed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Info' because it is not full-text indexed.]
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlI
System.Data.SqlClient.TdsP
System.Data.SqlClient.TdsP
System.Data.SqlClient.SqlD
System.Data.SqlClient.SqlD
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.Common.DbComma
System.Data.Common.DbDataA
System.Data.Common.DbDataA
System.Data.Common.DbDataA
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Page.Process
You need to define the Full-Text Search and do a Full Population before you can use it. I suggest you do some reading on the subject, as it is somewhat more complex than you may have anticipated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, that worked!
ASKER
acperkins,
Please visit https://www.experts-exchange.com/questions/21501438/Getting-error-trying-to-do-a-search-of-a-large-field-in-database.html
and post this same answer there so that I can give you more points.
:)
Please visit https://www.experts-exchange.com/questions/21501438/Getting-error-trying-to-do-a-search-of-a-large-field-in-database.html
and post this same answer there so that I can give you more points.
:)
>>post this same answer there so that I can give you more points.<<
I appreciate it. But since that is a duplicate question and the total exceeds the total of 500 points allowed, I suggest you post a message in Community Support to have the question deleted and the points refunded. Make sure to include a reference to that question.
I appreciate it. But since that is a duplicate question and the total exceeds the total of 500 points allowed, I suggest you post a message in Community Support to have the question deleted and the points refunded. Make sure to include a reference to that question.
ASKER
ok.
I didn't know where to post it, so I posted it in both places.
Sorry.
I didn't know where to post it, so I posted it in both places.
Sorry.
>>I didn't know where to post it, so I posted it in both places.<<
No problem and I appreciate the gesture. Usually the way it is done is as follows:
What if my question fits more than one technical area?
https://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi262
No problem and I appreciate the gesture. Usually the way it is done is as follows:
What if my question fits more than one technical area?
https://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi262
The accepted solution works a treat. Had to manually add each string column to the FTC. Trying to create this via Management Studio or Enterprise Manager simply wasn't working.
Many thanks,
Hillsman
Many thanks,
Hillsman