Full Text Searching With SQL 2005 Express Advanced
Jun 2, 2008
I'm using the Full text functionality of SQL 2005 Express Advanced and it works well.
However, the first time a query is run it take 20 seconds or so to actually return the search results. Thereafter, the search results are almost immediate.
That would be fine, except that if no further search is performed for approx 15 minutes or so, then we are back to the first scenario where it takes 20 seconds to return the results.
I assume this means that the full text catalog is not being held in cache at the server? Is there anyway to force it to do this?
My first thoughts were that Full Text within 2005 was an excellent tool, but if the first search always takes a long time then I will have to re-think as I can be sure that customers will get extremely annoyed at the response.
Do you know if there is any way around this or if there are any fixes imminent for this problem.....indeed, is it a problem or am I missing a fundamental setup issue?
What would be the implications if I created a small console application to perform a full text search once every minute at the server to keep the index cached?
Hi. I'm trying to get full-text search working on my SQL 2005 Express with Advanced Services and am having problems. I thought that I installed it correctly, and when I look in the services running, I see it SQL Server Fulltext Search(MSSQLSERVER). Also note that I have SQL Server 2005 Standard installed on this same laptop. I don't know if that Full text Search applies to the Standard, Express or both.
What I do see is that if I connect to the database engine named <mylaptop>, I can see the version is 9.0.1399 and I can see the check box to enable full-text indexing in a particular databases properties. When I run SELECT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'), I get a 1.
However, when I connect to the engine name <mylaptop>SQLExpress, I se the version is 9.0.3042, and I don't see the same check-box to enable full-text indexing. When I run SELECT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'), I get a 0.
I've never tried this before so I know I'm probably missing something basic. But, I have searched quite a bit and not found my answer. So, I'm looking to you for help.
I have installed the advanced services edition but cannot find out how to build and populate full text catalogs. Nothing shows on the MSSMSE tool and when I try to use a sql command to create a new catalog it says that the full text service is not installed. Am I missing something?
I have upgraded a SBS 2003 MSDE database (instance MSSQL$SHAREPOINT) to SQL Server 2005 Express Advanced Edition. This worked without a problem even when I enabled all the options for the upgrade including Full-text search.
I now want to have Full-text search on this instance of SQL 2005 with database name of STS_EVEREST_1.
I first tried to use the T-SQL command of "CREATE FULLTEXT CATALOG BBVisionCatalog AS DEFAULT;" I now know that the original database was created under SQL 2000 and therefore I needed to use SQL 2000 commands. So I used the following script:
USE STS_EVEREST_1 EXEC sp_fulltext_database 'enable' EXEC sp_fulltext_catalog 'BBVisionCatalog', 'create';
It produced the following ERROR messages:
(1 row(s) affected) Msg 7609, Level 17, State 2, Procedure sp_fulltext_database, Line 46 Full-Text Search is not installed, or a full-text component cannot be loaded.
I checked to see if the Microsoft Search Service was running. It was running.
I've downloaded SQL Server Express with Advanced Services from http://msdn.microsoft.com/vstudio/express/sql/download/ and installed all components. When I try to create a full-text catalog, I get the following message:
No full-text supported languages found.
select * from sys.fulltext_languages returns no lines.
How can neutral, English or maybe Hungarian word breakers be installed?
Have searched a good bit for a KB or other article but haven't been able to find one.
I have a 2003 server with SQL Server 2005 Express installed, but not the Advanced Services version. Recently installed an application that needs the Full Text search capability. Would prefer not to remove SQL Server Express and reinstall the Advanced version because I'm also using Symantec Backup Exec 11d which has its own instance on the SSExpress installation.
Is it possible to upgrade an instance to Advanced Services? If not, is it possible to upgrade the entire install?
There's got to be a how-to article somewhere on how to do this. Just can't seem to locate it at Microsoft or with Google.
I am using the following plumbing code to search a database column for a keyword. I can't use full-test indexing so I came up w/ this work around. But It has many flaws so I'm looking for a better way. Thx in advance.
'Open sql connection SqlConnection1.Open()
Dim datareader2 As SqlClient.SqlDataReader datareader2 = cmdFindRowsWithKeyword.ExecuteReader Dim strMsg As String Dim intRowToFlag As Integer Dim strRowsToGet As String Dim strKeywordAsTyped As String Dim strKeywordAllCaps As String Dim strKeywordAllLower As String Dim strKeywordFirstLetterCap As String Dim FirstLetter As String
'Assign keyword as typed to variable strKeywordAsTyped = txtSearchFor.Text 'Assign keyword as typed to variable then convert it to all uppercase strKeywordAllCaps = txtSearchFor.Text strKeywordAllCaps = strKeywordAllCaps.ToUpper 'Assign keyword as typed to variable then convert it to all lowercase strKeywordAllLower = txtSearchFor.Text strKeywordAllLower = strKeywordAllLower.ToLower 'Assign keyword as typed to variable then convert it so just the first letter is in uppercase strKeywordFirstLetterCap = txtSearchFor.Text FirstLetter = strKeywordFirstLetterCap.Chars(0) FirstLetter = FirstLetter.ToUpper strKeywordFirstLetterCap = strKeywordFirstLetterCap.Remove(0, 1) strKeywordFirstLetterCap = strKeywordFirstLetterCap.Insert(0, FirstLetter)
'If the string contains the keyword as typed in all caps all lowercase or w/ the 1st letter in caps then flag that row. If strMsg.IndexOf(strKeywordAsTyped) <> -1 Or strMsg.IndexOf(strKeywordAllCaps) <> -1 Or strMsg.IndexOf(strKeywordAllLower) <> -1 Or strMsg.IndexOf(strKeywordFirstLetterCap) <> -1 Then
cmdFlagRowsWithKeyword.Parameters("@recid").Value = intRowToFlag SqlConnection2.Open() Dim datareader3 As SqlClient.SqlDataReader datareader3 = cmdFlagRowsWithKeyword.ExecuteReader datareader3.Close() SqlConnection2.Close()
I am trying to run a full text serach on one field, a Varchar 2000. say the field contains: (before you break the seal of your new product box, please be careful to read all the instructions) ...for example I search for keywords that may be in this field Like: product box seal instructions and this row is included in the result set
but I would like to leave out words like all pronouns and 'a' and 'I' ...words that aren't going to matter to the search.
Does someone know where I can stgart in doing this full text searching?
I`ve just starting playing around with version 7.0 and was wondering if anyone knows how to implement the Full-text Searching feature. Its sound like a neat feature if I could just get it to work. Thanks in advance Joe
I've assumed responsibilty for a sqlserver 2000 that has many databases and has only 1 database that uses full text searching. That 1 application now wishes for me to update the noise words file to remove the single characters.
As far as I can tell, no other application is using the full text searching since I don't see any catalogs created for any of them.
So, if no other databases and applications in this sqlserver have catalogs created for them, can I safely assume that changing the noise words file will not impact any of them even if the other databases do have text fields in some tables?
I've used CONTAINS on a varchar field. in SQL SERVER 2000
the query was "Select name from description where CONTAINS(name,' "donot*" ')
say if I search for "Select name from description where CONTAINS(name,' "donot a*" ') ---it doesn't return rows.
as might be it is seeing that 'a' as the starting letter of AND key word which is used in CONTAINS but how to tell that it is my next letter in the search
Are there any plans to add full-text searching capability to SQLCE? I know it's available in SQL Server Express but it would still be useful for an embedded/desktop application -- SQLite recently added this.
I was wondering when is it worth using Full Text Searching as opposed to using LIKE? Also, since I will be using third party for hosting my site, generally, do hosts support Full Text Searching?
I'm wrtiting a local site search egine but I need to make use of functions like FREETEXTABLE for instance. In order to use this I have to have the' Full Text Search table' enabled for a table. Now the Microsoft Search Service is running in MSDE; of that I'm sure. However when I try to enable the full text searching on a table or database the option that I'm supposed to choose is grayed out which means I can't select it. What's wrong? What do I have to do to be able to use that option? I' short of time and would appreciate n answer a.s.a.p. Thanks
I have created the full text catalogs for my tables, so that I can search all the tables at the same time, from any of the fields in the catalogs.
I have created the following procedure:-
create procedure usp_full_text(@findtext varchar(255)) as select set_id as URN, input_date as date_of_record from set_records where freetext (*, @findtext) There are a few union selects under this, but
If I search for perhapse 'SMITH' from within access, then this will bring back all the records which have smith in them somewhere, which is good, however if I repeat the search for 'smit' then I get no records returned.
How can I change the code to find the parts of words, or string of charactors, and how can I set this to do a soundex search?
Hopefully all this is possible, i just need pointers on how to achieve this, or I could be sat there for days.
Hi I have installed SQL Server 2005 Enterprise Edition on my laptop and get the following version:
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2)
I know that it cannot install the enterprise version on my OS, but I would like the full-text feature. Therefore I downloaded the SQL Server Express Toolkit and selected to install the full-text feature.
BUt...I still do not have the full-text feature installed. Any ideas why not??? can my version of SQL support it? if not, how do I get my way around this?
I am following the how to in the sql studio management express and for text indexing it says
================================================ To enable a database for full-text indexing
In Object Explorer, expand the server group, right-click the database for which you want to enable full-text indexing, and then select Properties.
Select the Files page, and then select Use full-text indexing This worked ok ==================================================
next it says to
================================================== To enable a table for full-text indexing
Expand the server group, expand Databases, expand User Databases, and expand the database that contains the table you want to enable for full-text indexing.
Right-click the table that you want to enable for full-text indexing.
Select Full-Text index, and then click Enable Full-Text indexing.
Hello ! When I try to search into a database table I get the following error : Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Customers' because it is not full-text indexed. Please tell me how can I make the index. I am using SQL Server Express 2005,VWD 2008 and WIN XP. Thank You !
I have conflicting info about whether SQL 2005 Express contains full-text search and catalogueing functionality. I have read several places online where it is stated that "SQL Server 2005 Express Edition with Advanced Services" contains full-text search, but that seems to conflict with the info presented here:
im pretty new to sql server I created a database with full text enabled, I created the indexes and queried the db in managment studio express and everything worked great. when i try the same thing from within vc# it tells me that i have to enable fulltext indexing and create an index before i can use CONTAINS
what do i need to do to make my already fully functional fulltext indexes work from within vc# express 2005
I am installing a FTS system on an existing system (that used LIKE % queries!! hahaha)
Anyway, it is working pretty well (AND FAST!) but when I type in a common word like "damage" I get like 32,000 records. Now, the server handles those records in about one second but the ASP page that returns the results takes about one MINUTE to download. When I save the source, it is almost 12 MEGS!!
So, basically, I am streaming 12 megs across the pipe and I want to reduce that.
I would like the system to detect over maybe 500 records and cancel the search.
I have put a "TOP 500" into the search and that actually works pretty well but is there a better/smarter method?
For one day, this SPROC executes very quickly to return results on a Full Text catalog.
ALTER Procedure dbo.sp_RSSHarvestedHeadlines_FullTextSearch ( @ORKeywords varchar(4000) = 'xxxx', @ANDKeywords varchar(4000) = 'xxxx', @NOTKeywords varchar(4000) = 'xxxx', @SourceID int = -1, @IsHidden bit = null ) As set nocount on
SELECT HHL.HeadlineID, HHL.Title, HHL.Link, HHL.[Description], HHL.PubDate, HHL.GMTDateAdded, RSSSources.SourceTitle, RSSSources.SourceLink FROM RSSHarvestedHeadlines HHL INNER JOIN RSSSources ON HHL.SourceID = RSSSources.SourceID WHERE HHL.PublishedFlag = 0 AND (@IsHidden is null OR HHL.HideFlag = @IsHidden) AND (@SourceID = -1 OR HHL.SourceID = @SourceID) AND (@ORKeywords = 'xxxx' OR (CONTAINS(HHL.Title, @ORKeywords) OR CONTAINS(HHL.Description, @ORKeywords))) AND (@ANDKeywords = 'xxxx' OR (CONTAINS(HHL.Title, @ANDKeywords) OR CONTAINS(HHL.Description, @ANDKeywords))) AND ( @NOTKeywords = 'xxxx' OR ( (NOT CONTAINS(HHL.Title, @NOTKeywords) AND NOT CONTAINS(HHL.Description, @NOTKeywords)) ) )
ORDER BY HHL.GMTDateAdded DESC, HHL.PubDate DESC
But somethign happens overnight and in the morning the sproc times out. While running (even from a new query window on the SQL 2005 server itself) it utilizes 100% CPU until it times out.
When I pass default parameters to the sproc (not using any part of the query that uses Full Text) the sproc returns every record in the database very quickly. No hang ups.
But the moment I add any text in say the @ORKeywords parameter, for example, the sproc utilizes 100% CPU for maybe 15 seconds and then times out.
By accident I discovered that I can fix this temporarily by copying the database. I don't use the new copy or anything. Just the act of copying the database fixes it. The sproc then executes normally, and quickly. But the next morning it's back to slow again.
Note, over night I am adding about 1000 records to the table.
Would automatic updates to the FT Catalog choke on 1000 records?
Also note that one of the fields being cataloged is a "Text" field (blob). Would that cause this?
Would what text is being added to the table matter? What if an invalid character was added (like some european character or a control character)? Would FT indexing hang up on that?
I am at a loss.
The following code will recreate the table:
CREATE TABLE [dbo].[RSSHarvestedHeadlines]( [HeadlineID] [int] IDENTITY(1,1) NOT NULL, [SourceID] [int] NOT NULL, [Title] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Link] [varchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Description] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PubDate] [datetime] NULL, [GMTDateAdded] [datetime] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_GMTDateAdded] DEFAULT (getutcdate()), [GMTLastHarvested] [datetime] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_GMTLastHarvested] DEFAULT (getutcdate()), [HideFlag] [bit] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_HideFlag] DEFAULT ((0)), [PublishedFlag] [bit] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_PublishedFlag] DEFAULT ((0)), [EditStamp] [timestamp] NOT NULL, CONSTRAINT [PK_RSSHarvestedHeadlines] PRIMARY KEY CLUSTERED ( [HeadlineID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
For one day, this SPROC executes very quickly to return results on a Full Text catalog.
ALTER Procedure dbo.sp_RSSHarvestedHeadlines_FullTextSearch ( @ORKeywords varchar(4000) = 'xxxx', @ANDKeywords varchar(4000) = 'xxxx', @NOTKeywords varchar(4000) = 'xxxx', @SourceID int = -1, @IsHidden bit = null ) As set nocount on
SELECT HHL.HeadlineID, HHL.Title, HHL.Link, HHL.[Description], HHL.PubDate, HHL.GMTDateAdded, RSSSources.SourceTitle, RSSSources.SourceLink FROM RSSHarvestedHeadlines HHL INNER JOIN RSSSources ON HHL.SourceID = RSSSources.SourceID WHERE HHL.PublishedFlag = 0 AND (@IsHidden is null OR HHL.HideFlag = @IsHidden) AND (@SourceID = -1 OR HHL.SourceID = @SourceID) AND (@ORKeywords = 'xxxx' OR (CONTAINS(HHL.Title, @ORKeywords) OR CONTAINS(HHL.Description, @ORKeywords))) AND (@ANDKeywords = 'xxxx' OR (CONTAINS(HHL.Title, @ANDKeywords) OR CONTAINS(HHL.Description, @ANDKeywords))) AND ( @NOTKeywords = 'xxxx' OR ( (NOT CONTAINS(HHL.Title, @NOTKeywords) AND NOT CONTAINS(HHL.Description, @NOTKeywords)) ) )
ORDER BY HHL.GMTDateAdded DESC, HHL.PubDate DESC
But somethign happens overnight and in the morning the sproc times out. While running (even from a new query window on the SQL 2005 server itself) it utilizes 100% CPU until it times out.
When I pass default parameters to the sproc (not using any part of the query that uses Full Text) the sproc returns every record in the database very quickly. No hang ups.
But the moment I add any text in say the @ORKeywords parameter, for example, the sproc utilizes 100% CPU for maybe 15 seconds and then times out.
By accident I discovered that I can fix this temporarily by copying the database. I don't use the new copy or anything. Just the act of copying the database fixes it. The sproc then executes normally, and quickly. But the next morning it's back to slow again.
Note, over night I am adding about 1000 records to the table.
Would automatic updates to the FT Catalog choke on 1000 records?
Also note that one of the fields being cataloged is a "Text" field (blob). Would that cause this?
Would what text is being added to the table matter? What if an invalid character was added (like some european character or a control character)? Would FT indexing hang up on that?
I am at a loss.
The following code will recreate the table:
CREATE TABLE [dbo].[RSSHarvestedHeadlines]( [HeadlineID] [int] IDENTITY(1,1) NOT NULL, [SourceID] [int] NOT NULL, [Title] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Link] [varchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Description] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PubDate] [datetime] NULL, [GMTDateAdded] [datetime] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_GMTDateAdded] DEFAULT (getutcdate()), [GMTLastHarvested] [datetime] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_GMTLastHarvested] DEFAULT (getutcdate()), [HideFlag] [bit] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_HideFlag] DEFAULT ((0)), [PublishedFlag] [bit] NOT NULL CONSTRAINT [DF_RSSHarvestedHeadlines_PublishedFlag] DEFAULT ((0)), [EditStamp] [timestamp] NOT NULL, CONSTRAINT [PK_RSSHarvestedHeadlines] PRIMARY KEY CLUSTERED ( [HeadlineID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]