This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is it possible to get Lightspeed to enable full text serch in MSSQL going from designer to database? I mean, you are able to mark the various properties as indexed properties, so you have much of the information needed to make it happen?
|
|
|
That's not currently possible, but it sounds like it would be a smart thing to do. I'll log a feature request for it. Thanks! |
|
|
Hi Ivan, Is there any update on this feature request? I found myself spending a couple of hours getting this going with sql server 2005. The documentation doesn't have details on how to set it up and I tried searching this forum. Here are the steps I took, not sure if I did it right??
USE dbName --1 Enable FTS
select fulltextserviceproperty('isfulltextinstalled')
--if 0 then check then FTS Service is started, also Add/Remove WinComponents and check Indexing, otherwise its likely FTS wasn't selected during installation (instance based)...
select DatabaseProperty(db_name(), 'IsFulltextEnabled') as Is_Fulltext_Enabled , db_name() as dbName
--if 0 then EXEC sp_fulltext_database 'enable'
--1 Create the catalog (unless you already have) EXEC sp_fulltext_catalog 'dbNameCatalog','create'
--2 Add a full text index to a table EXEC sp_fulltext_table 'Customer', 'create', 'dbNameCatalog', 'PK__Customer__7C8480AE' EXEC sp_fulltext_table 'Resource', 'create', 'dbNameCatalog', 'PK__Resource__22AA2996' EXEC sp_fulltext_table 'GS', 'create', 'dbNameCatalog', 'PK__GS__023D5A04'
--3 Add a column to the full text index EXEC sp_fulltext_column 'Customer', 'FirstName', 'add' EXEC sp_fulltext_column 'Customer', 'LastName', 'add'
EXEC sp_fulltext_column 'Resource', 'FirstName', 'add' EXEC sp_fulltext_column 'Resource', 'LastName', 'add'
EXEC sp_fulltext_column 'GS', 'Name', 'add' EXEC sp_fulltext_column 'GS', 'BarcodeNumber', 'add'
--4 Activate the index EXEC sp_fulltext_table 'Customer','activate' EXEC sp_fulltext_table 'Resource','activate' EXEC sp_fulltext_table 'GS','activate'
--5 Start full population EXEC sp_fulltext_catalog 'dbNameCatalog', 'start_full'
--------------------------------------------------------------------------------- Then when I tried to build the index the first time, using this code: LightSpeedContext<ModelUnitOfWork> context = new LightSpeedContext<ModelUnitOfWork>("Development");
context.SearchEngine = new Mindscape.LightSpeed.Search.SearchEngineBroker(new Mindscape.LightSpeed.Search.LuceneSearchEngine()); context.SearchEngine.Rebuild(IsolationLevel.ReadCommitted, typeof(Customer), typeof(GS), typeof(Resource));
I got the error: Search engine index directory was not specified or does not exist The fix was specifying the searchEngineFileLocation in the config:
<add name="XXX" connectionString="Initial Catalog=MTS;database=dbName;Integrated Security=SSPI;"/> <add name="Development" connectionStringName="XXX" dataProvider="SqlServer2005" identityMethod="GuidComb" pluralizeTableNames="false" searchEngineClass="Mindscape.LightSpeed.Search.LuceneSearchEngine" searchEngineFileLocation="D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\Lucene" cascadeDeletes="false" />
When I tried to build the index the second time I got an error (like): The specified directory is not empty The fix was creating an empty folder under FTData called "Lucene".. as I couldn't delete one of the files, even with unlocker.
Then the query worked: Query query = new Query();
query.SearchQuery = "Joe";
using (var unitOfWork = context.CreateUnitOfWork())
{
IList<Customer> c = unitOfWork.Find<Customer>(query);
}
Cheers,
|
|
|
Hi, I started asking myself what config is required for other databases beside MSSQL. So I gave sqlLite3 a go and it seems to work out-of-the-box no config. Awesome! So, is MSSQL the only dB that requires config? and seeing LightSpeed uses Lucene did I even need to create those 1-5 FTS SQL setup steps? Cheers, |
|
|
nvm, now I see the op wasn't wanting to use Lucene... |
|