Sunday, January 3, 2010 Demo configuration document

Step 1 Install

See this link: Installation of

Step 2 Login

Run QueryAnalyzer and input IP address point to the service. Click Login then next step.





Step 3 Create database

Click File->Open
Choose CreateDatabase.sql then create News database




The sql for creating database is


exec sp_adddatabase 'News', 'd:\test\news\', 'SQLSERVER2005', 'Data 
Source=(local);Initial Catalog=News;Integrated Security=True'


The first parameter is the database name that refers to the Here named News.

The second parameter is the default full-text index path of the database. Here is the “d: \ test \ news \”.

The third parameter is the default database adapter name

Here designated as SQLSERVER2005.  SQLSERVER 2005 database adapter can support SQLSERVER 2005 and later versions.

The fourth parameter is the default connection string, this string is used to connect relational database via

Note: Before you create a database in, you must create a database in SQLSERVER firstly. If you want to use other database in SQLSERVER, you only need to modify the connection string.

Click Excute




Choose the server node in the left, click right button and click Refresh. You can see the news database in the combobox.


Step 4 create table



Click File->Open then open CreateTableEng.sql,Choose news database at the combobox in up-left, click Excute。



exec sp_droptable 'news';
Create table News
Title nvarchar(max) Tokenized Analyzer 'EnglishAnalyzer' NOT NULL Default '',
Content nvarchar(max) Tokenized Analyzer 'EnglishAnalyzer' NOT NULL Default '',
Time Date Untokenized NOT NULL Default '1990-01-01',
Url nvarchar(max) NULL

The first line is to delete the news data table. If the news data table does not exist, this command will do nothing. The second part of command is to build the table. CREATE TABLE sql command like TSQL very much. You should specify the analyzer for the full-text field. Here is EnglishAnalyzer that is installed in by default.  If you want to use other analyzer, you can implement the analyzer interface and install it in

Step 5 Import test data for news


File->Batch Import choose EnglishNews.sql.

You can download EnglishNews.slq on




Click Import then batch import news data。


Execute flowing sql after import finished to optimize the index.

exec SP_OptimizeTable 'News'



Test following sql:

select top 10 * from news where content match 'hello' order by score desc




Web configuration

connectionString="Data Source=;Initial Catalog=News;"

You can set the connect string for at this section.

The Index.CacheTimeout in App_Code/Index.cs can set the data cache timeout for SQLClient.

Default is 0.

-1: There is no cache

0: Has data-cache, but the timeout is 0. This case, for each query, SQLClient will ask service about the table changing. If the table has not changed, read from the data cache, otherwise read from server.

N: Cache N seconds,  ask service about the table changing after time-out.