Web Design Glasgow

Web Strategy Blog

For the life of me, I couldn’t figure out why I didn’t get different results, using SQL Server 2005, for a simple Full-Text Search query and a Full-Text Search query using the FORMSOF and INFLECTIONAL keywords.

What I stumbled across eventually was that when creating and configuring my SQL Full-Text Indexes, I had left the language parameter as the default selection. When I changed this to English, voila!, my FORMSOF (INFLECTIONAL, @query) queries started to produces fantastic search results!

Also, an example query showing how to parameterize the the search term, and how to rank your results:

@query varchar (100)

SET @query = ‘FORMSOF (INFLECTIONAL, ‘ + @query + ‘)’

SELECT FT.rank, P.id, P.title
FROM Products P
INNER JOIN CONTAINSTABLE (Products, *, @query) AS FT ON P.id = FT.[key]

If you’ve any questions, I’ll do my best to help. Also, if you’re just starting with Full-Text, check out my posts on installing Full-Text Search on SQL Server 2005 and how to setup and configure SQL Server 2005 Express Full-Text Search the easy way.

del.icio.us:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 digg:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 spurl:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 furl:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 reddit:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 fark:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 Y!:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005 magnolia:Troubleshooting your FORMSOF & INFLECTIONAL searches not working, SQL Server 2005

I recently had to setup a search facility on a website driven by SQL Server 2005 Express. My natural choice was SQL Server’s Full-Text Search feature, but setup was not entirely intuitive, and the web was full of misinformation. I’ve put together a tutorial to save you time.

If you’re not sure if your have Full-Text installed, read my post on installing SQL Server 2005 Express Full-Text Search.

Once, Full-Text is installed, managing your index is actually very simple:

  • Browse to the tables of your database, right click and select ‘Design’
  • In the main window, right click and select ‘Fulltext Index…’
    If you see the message, ‘You need to define one or more full-text compatible indexes on the table to create a full-text index’ and the ‘Add’ button is greyed out, it’s because you don’t have a column the database can use to uniquely identify each row. Make sure you have a primary key, and if you’ve no success, start your troubleshooting with this video - it discusses unique indexes about 1/3 of the way through.
  • Otherwise, click ‘Add’, and you have a new index.
  • To configure the columns in the index, click the ‘…’ button next to ‘Columns’
  • For each column, select the column, and select the appropriate language
    To understand why the language parameter is important, see my post on use of the FORMSOF and INFLECTIONAL keywords in SQL Full-Text Search

It’s that easy! Any questions, let me know and I’ll do my best to help.

del.icio.us:SQL Server 2005 Express Full-Text Search Setup Tutorial digg:SQL Server 2005 Express Full-Text Search Setup Tutorial spurl:SQL Server 2005 Express Full-Text Search Setup Tutorial furl:SQL Server 2005 Express Full-Text Search Setup Tutorial reddit:SQL Server 2005 Express Full-Text Search Setup Tutorial fark:SQL Server 2005 Express Full-Text Search Setup Tutorial Y!:SQL Server 2005 Express Full-Text Search Setup Tutorial magnolia:SQL Server 2005 Express Full-Text Search Setup Tutorial

I’ve just been struggling to enable full-text search on my installation of SQL Server 2005 Express Edition, and so want to share the solution.

If, like me, the ‘Use full-text indexing’ checkbox was greyed out under Database > Properties > Files, you first need to test whether Full-Text Indexing is installed or not. To do this, execute the query.

use [dbname]
select fulltextserviceproperty(’isfulltextinstalled’)

If this returns 0, you need to install Full-Text Search.

Firstly, did you install SQL Server 2005 Express Edition Advanced Series? Only the Advanced Series contains full-text. If not, you may need to reinstall.

However if so, then you just need to change the installation to include Full-Text Indexing. But if you originally installed from a download from the above link (most of you) then you’ll find that when you try to modify the installation via Control Panel > Applications / Programs, Windows prompts you for the installation file ’sqlrun_sql.msi’. This is because the download unpacked the installation files to a temporary folder which can no longer be found.

To resolve this issue, you need to download the file again from the link above, move it to a folder, and unzip (I used WinRAR). Then point Windows to the sqlrun_sql.msi file (under /setup, wherever you unzipped the download) when it prompts you for the installation file.

For additional info, see here.

For additional support setting up Full-Text Search once installed, watch this video on the topic from Micosoft, BUT I think you’ll find my new tutorial on seting up Full-Text Search in SQL Server 2005 Express much quicker and more intuitive to be honest..

del.icio.us:SQL Server 2005 Express with the Full-Text option greyed out digg:SQL Server 2005 Express with the Full-Text option greyed out spurl:SQL Server 2005 Express with the Full-Text option greyed out furl:SQL Server 2005 Express with the Full-Text option greyed out reddit:SQL Server 2005 Express with the Full-Text option greyed out fark:SQL Server 2005 Express with the Full-Text option greyed out Y!:SQL Server 2005 Express with the Full-Text option greyed out magnolia:SQL Server 2005 Express with the Full-Text option greyed out

Categories

Popular

Archive

Add to Technorati Favorites