Web Design Glasgow

Web Strategy Blog

I wrote a post before the weekend about some performance issues with MooTools, DHTML and AJAX, but having found the solution to a related problem this morning, I wanted to post a followup.

I’ve been working with a large, dynamically generated and AJAX populated table that features sorting, filtering and row highlighting, and was finding that my table took a long time to render, and was also very slow to close - that is, when I tried to close the window or refresh the page, there would be a delay when the browser would first hang for a few seconds. IE often (but not always) popped up the error/prompt Stop this script running?, and Firefox less often threw it’s Unresponsive Script warning.

I’d heard of MooTools’ garbage collection functions that reduced memory leakage, and figured that these were probably responsible. I then found Kevin Smith’s write up of his similar experience, and came to understand the problem. MooTools’ garbage collection takes time to clean up any element that has been extended. My table was executing the following code, effectively extending every table row in the table, resulting in some 500+ extended elements.

// MooTools Code
Element.extend({

getChildren: function(){
return $$(this.childNodes);
},

});

// My Code
this.tablerows = this.body.getChildren();

When it came to cleanup, this javascript processing took longer than IE’s configured script timeout, and thus prompted the warning.

To avoid this cleanup overhead, you’ll have to avoid extending the elements with MooTools’ extensive set of functions and instead extend the specific elements in question with the specific functions required.

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.

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, you need to create your index:

CREATE FULLTEXT CATALOG MyFullTextCatalog

Managing your index is then 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.

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..

Iain Porter - Glasgow Web Designer, Search Engine Optimiser, and Web Strategy Consultant

Webmaster Jam Sessions

Posted by Iain on Thu (22/02/07) at 7:37am to Web Design, Development, Search Engine Optimisation

From the same conference, Andy Budd summarises and presents links to several other presentations from industry spokespeople.

Next Page »

Categories

Archive

Add to Technorati Favorites