Hello: Please let me know if another forum is a better place to post! I have successfully enabled SQL Server 2005 Full Text (MSFTESQL) on my database, created the FT Catalog in Storage, and defined a FT Index for a table ( 1 table for testing).
I have also created an expansion and replacement entry in the Thesaurus (tsENU.xml) and removed the comments. I have restarted the server and the FTS Service, In addition, (per your comments to another user) I have used sqlcmd to confirm my default language of 1033.
I am unable to get any results from the Thesaurus file. I am able to run queries against the index using CONTAINS and FREETEXT. I get results - however I only get the same thing I would get from the CONTAINS portion of the query. Also ..SQLSERVER2995MSFTEUser$.. has permission on the FTData folder.
// This query //
SELECT name, description FROM table WHERE CONTAINS(description, ' FORMSOF(THESAURUS, blender) ')
// on this Thesaurus located in this C: folder MSSQL.1MSSQLFTData sENU.xml //
A search for blender returns all strings with the exact word blender in them - not even any plural forms. A search for blend or grind returns nothing. FREETEXT does a little better returning blender, blenders, blending. Still no grind,chop, or food process.
I am trying to get the full-text search thesaurus to work in Sql Server 2005 Express edition. I live in the USA so I assume the tx.ENU.xml is the appropriate file to modify. I used Notepad to modify the tx.ENU.xml file as follows:<XML ID="Microsoft Search Thesaurus">
</XML> I closed Management Studio and reopened to allow MSFTESQL service to restart. Then I ran these queries:SELECT FullDocNo FROM FullDocuments WHERE CONTAINS(SectionText, 'littre') *** returned 3 rows ***SELECT FullDocNo FROM FullDocuments WHERE CONTAINS(SectionText, 'leydig') *** returned 169 rows ***SELECT FullDocNo FROM FullDocuments WHERE CONTAINS(SectionText, ' FORMSOF(THESAURUS, littre) ') *** returned 6 rows *** Thus the Thesaurus does not seem to be working since it should have returned at least 169 rows. I rebooted my entire system to make sure Sql Server is starting fresh. Any help in sorting this out will be greatly appreciated.
Hi! I am moving this from the Transact SQL forum as I am not getting a reply. Hope it's OK! Hello: I have successfully enabled SQL Server 2005 Full Text (MSFTESQL) on my database, created the FT Catalog in Storage, and defined a FT Index for a table ( 1 table for testing).
I have also created an expansion and replacement entry in the Thesaurus (tsENU.xml) and removed the comments. I have restarted the server and the FTS Service, In addition, (per your comments to another user) I have used sqlcmd to confirm my default language of 1033.
I am unable to get any results from the Thesaurus file. I am able to run queries against the index using CONTAINS and FREETEXT. I get results - however I only get the same thing I would get from the CONTAINS portion of the query. Also ..SQLSERVER2995MSFTEUser$.. has permission on the FTData folder.
// This query //
SELECT name, description FROM table WHERE CONTAINS(description, ' FORMSOF(THESAURUS, blender) ')
// on this Thesaurus located in this C: folder MSSQL.1MSSQLFTData sENU.xml //
A search for blender returns all strings with the exact word blender in them - not even any plural forms. A search for blend or grind returns nothing. FREETEXT does a little better returning blender, blenders, blending. Still no grind,chop, or food process.
I€™ve been trying to add keywords to the thesaurus used for SQL Server 2005 Full Text services but do not seems to get any improved results. For example, I have a catalogue of article titles which contains titles such as €˜CRM€™ and then some others use the words €˜Customer Relationship Management€™, the ideal solution I would have thought was SQL Servers thesaurus support, I€™ve been though and added the values:
to the txGlobal.xml file in the SQL Servers FTData directory, I then amended by test query to use this clause: FORMSOF(THESAURUS,"CRM") The idea being that when I search for CRM it will bring back articles with Customer Relationship Management also. However I€™m just getting results for the same results as for the word 'CRM' and no expansion is taking place it would seem.
Would anyone be able to clarify what the best approach to making this work would be:
Do I need to restart the SQL Server FullText service after making any changes to the XML files? (Done this, no sucess)
Do I need to restart the SQL Server service after making any changes to the XML files? (Done this, no sucess)
Do you need to re-populate the full text catalogues after making a change the XML files? (Done this, no sucess)
If this syntax correct when trying to utilise the thesaurus? CONTAINSTABLE (Article_Metadata, *, €˜FORMSOF(THESAURUS,"CRM")€™ ) (It doesn;t give any errors, just no improved results over: CONTAINSTABLE (Article_Metadata, *, €˜"CRM"€™ )
Thank you for taking the time to read this, I need all the advise and help I can get on this ... so please post anything you think would work ... A little confused I am: Have a database table called "people" with "person name" and "ID" field. My ASP.NET application mainly stores articles in article table. An article's Article text mentions various people's names in different combinations (e.g. John, Smith, John Smith, Smith John, etc) Is there any way, I could compare the article text stored in article table with people table and get the people from people table along with their ID's who have been mentioned in that article? ... so in an article "i love john smith ... and i think Mr smith has always been helpful", I get John Smith back... Not too sure being honest, what is the best way of implementing this, looking for the most efficient way, probably using XML? SQL Query or may be ASP.NET's code behind? Thanks once again for taking the time. Cheers, Tyro
SELECT * FROM Person WHERE CONTAINS(*,'FORMSOF(Thesaurus,"Tony")')
the result is only the record containing 'Tony' but I need Tony, Roby and Mary to be treated as synonimus and for that reason the result should be the 3 records containing all the 3 names.
Hi, i'm trying to do a full text search on my site to add a weighting score to my results. I have the following database structure: Documents: - DocumentID (int, PK) - Title (varchar) - Content (text) - CategoryID (int, FK) Categories: - CategoryID (int, PK) - CategoryName (varchar) I need to create a full text index which searches the Title, Content and CategoryName fields. I figured since i needed to search the CategoryName field i would create an indexed view. I tried to execute the following query: CREATE VIEW vw_DocumentsWITH SCHEMABINDING ASSELECT dbo.Documents.DocumentID, dbo.Documents.Title, dbo.Documents.[Content], dbo.Documents.CategoryID, dbo.Categories.CategoryNameFROM dbo.Categories INNER JOIN dbo.Documents ON dbo.Categories.CategoryID = dbo.Documents.CategoryID GOCREATE UNIQUE CLUSTERED INDEX vw_DocumentsIndexON vw_Documents(DocumentID) But this gave me the error: Cannot create index on view 'dbname.dbo.vw_Documents'. It contains text, ntext, image or xml columns. I tried converting the Content to a varchar(max) within my view but it still didn't like. Appreciate if someone can tell me how this can be done as surely what i'm trying to do is not ground breaking.
Hello everyone ! I want to perform Full Text Search with SQL Server 2000. My documents (.doc, .xls, .txt, .pdf) are stored in a SQL Server field which is binary (the type of the column is image). I would like to know, how you can extract pieces of text from the documents. Example: I have a ASPX page with codebehind in C# making the search in a table in SQL server that is full text indexed. I make a search looking for the word "peace", than SQL server will take care about the search and return it to me the rows that match with that. But also I'd like to extract the 50 characters before and after where sql server found the word "peace" to show in the result page. Does anyone has any idea how to work around it ? Best regards. Yannick
I have a column in a table that has a type TEXT,when I pull the length of a row it returns 88222 but when I select from that column it dows not show all the text in the result set.
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()
Can you not add a text column to a full text index?? If I change it to a nvarchar it works fine but if I change it to a text column it wont index. Anyone know how to fix this?
I have a text column which my users use extensively for like queries. The table has 1.3 Millon rows and has seen som eperformance issue ie it does a table scan and blocks other processes.
I was wondering if anyone how to handle this coulmn can I create indexes or better can text column support full text indexing.
Anyone who can shed any ideas as what might be the best possible solution will be great
Has anyone created a Thesaurus file that is using it? Specifically, has anyone set up a First Name thesaurus file and is it possible to get a hold of it. Why reinvent the wheel if someone has already done this. I am creating a database that needs to return records for fuzzy matches on first names. I don't know what all forms of the names can be such as Robert, Bob, Bobby, Bert or Sue, Suzie, Susie, Susan, Suzanne, etc. and I am betting someone has created something already that can be a starting point at least.
What about the Thesaurus Word currently uses? Does anyone know what the physical file name and location is of the thesaurus file Word uses?
I remembered that the Thesaurus that comes with SQL Server is essentially empty.Is there a Thesaurus that can be downloaded for US English so I won't have to sit there with Roget's doing data entry for a few weeks?
When I issue a search for "415 volt" I am getting matches on records with "3" in the data, not just "3 phase" - example query below :
select tblp.productid, tblp.productcode, tblp.description, KEY_TBL1.RANK from tblProduct tblp INNER JOIN FREETEXTTABLE(tblProduct, description, '"415 volt"') AS KEY_TBL1 ON tblP.ProductID = KEY_TBL1.[KEY] ORDER BY KEY_TBL1.RANK DESC
It is returning items that don't have the word "phase" in at all and just have "3"! I have had to take all numbers out of the stop list as we sell a lot of technical items that will be searched for by size / voltage etc.
i am tring to create the full text catalog I am following the direction at http://technet.microsoft.com/en-us/library/ms189520.aspx but on the last command it gives me an error
'PK_problem' is not a valid index to enforce a full-text search key. A full-text search key must be a unique, non-nullable, single-column index which is not offline, is not defined on a non-deterministic or imprecise nonpersisted computed column, and has maximum size of 900 bytes. Choose another index for the full-text key.
also I tried the wizard in the managment express but it does not have a option when I right click on the table for Full-Text Index
I created a new catalog and a new index but when I start a search the grid come back empty I didnt insert any data into the table until after I created the catalog and index I dont think it has indexed the data yet. How do I force this or make it???? I have another example where I inserted data and then created the catalog and index and did a search and the proper rows came back but then I inserted new data and searched on a keyword that should have brought it up but nothing showed?
Hi, I have a SQL statement that works great when I don't use a SQL Parameter, but when I do it just takes the @Searchfor as literal text "@SearchFor" instead of the string @SearchFor represents. Any ideas? Below is the two versions of the sql statements sqlComm.Parameters.Add(new SqlParameter("@SearchFor", strSearchFor)); sqlComm.CommandText = "SELECT RANK, intID, chTitle, chDescription " "FROM FREETEXTTABLE( tblItems, *, 'ISABOUT("+ strSearchFor +" WEIGHT(1.0))') a " + "JOIN tblItems b on a.[KEY] = b.intID ORDER BY RANK DESC; ";
sqlComm.Parameters.Add(new SqlParameter("@SearchFor", strSearchFor)); sqlComm.CommandText = "SELECT RANK, intID, chTitle, chDescription " + "FROM FREETEXTTABLE( tblItems, *, 'ISABOUT(@SearchFor WEIGHT(1.0))') a " + "JOIN tblItems b on a.[KEY] = b.intID ORDER BY RANK DESC; ";
I have a Full-text search that is being performed on a variable (@Description) see part of querie below: WHERE (CONTAINS([Description], @Description) This search only seems to work when a text fo 3 or greater characters is used Ball, but not for "an" or "a". it also does not search on part of a word i.e. "Gard" of "Garden" Two things: 1) How do I perform the CONTAINS search for part of a word or "a". 2) How do I perform a search that returns all values, when I leave the input feild blank it returns no records. Many thanks in advance
Hi I have a full text index on my product table. When I do a search for Record, it returns all values for Record and Records.Now If I do a search with a spelling mistake say Recod . it doen't return anything.How can I get the full text to return my query even if there is a spelling mistake ? Thanks My query:SELECT * From Product WHERE FREETEXT (description, @SearchString)
I have implemented Full text search in my web application. I am using sql server 2005 database. I used “contains “Keyword for full text search. These are syntax as given below: CONTAINS ( { column | * } , '< contains_search_condition >' ) < contains_search_condition > ::= { < simple_term > | < prefix_term > | < generation_term > | < proximity_term > | < weighted_term > } | { ( < contains_search_condition > ) { AND | AND NOT | OR } < contains_search_condition > [ ...n ] } My search gives correct results according to AND NOT and OR. But, it is not working if I used AND. Please give me solution. Its very urgent for me……
full text indexing Hi, In SQL Server 2005, if I set full text indexing enables in column MyDesc and 1. use “Select * from MyTable where MyDesc LIKE ‘%abc%’� would this be using full text indexing? Or have to use Contains to get it be in use? 2. Once I create the full-text index, should I be setting it to populate periodically? Isn’t it populating itself?
hi all.i want to search, for example :"test string" in database : table have column(name) , i want to search all rows with column(name) is "test " or "string" or "test string"i don't want to use(full text search of sqlserver 2005 ) can i help me.thanks in advance
right-click do on database and selected properties,selected files page check box "use full-text indexing" is disable. how can enable check box above for sql server 2005 on windows xp? thanks,mohsen
How might it be possible to have on the fly full-text indexing utilizing the FREETEXT and CONTAINS statements so that when I enter a piece of data into the database it is immediatly searchable using the full-text indexing features?