DotNetFirebird.org DotNetFirebird
Using Firebird SQL in .NET.
Monday, January 17, 2005

Fulltext Search in Firebird

Firebird doesn't support fulltext search. You need to rely on third party tools. That seems odd, but it doesn't have to be so bad as it looks at first.

I am using DotLucene. It is an open source .NET library (ported from Java) that can index any data (structured or unstructed) that you are able to convert to raw text.

On a server, it is no problem to store the index in a separate directory (you can also load it to RAM to make your searches super fast - if you have enough RAM, of course). In a desktop application, it might be useful to store the index in a Firebird database.

For example: MySQL fulltext search has these drawbacks (compared to DotLucene):

  • You can use it only in MyISAM tables (i.e. no transactions)
  • You can't browse the index (see Luke)
  • You need to store transformed text in the DB (i.e. HTML without tags)
  • It doesn't support highlighting of the query words in the result
  • You will hardly modify the sources to do custom changes
  • The license doesn't allow to use it in commercial application for free
  • It is reported to be slow on large data sets

Comments:

Could you post some example code on how to add full-text capabilities to firebird?
Before I will post some Firebird-specific sample you can take a look at DotLucene: Full-Text Search for Your Intranet or Website using 37 Lines of Code article at CodeProject.

The main difference from that example is that you need to load the HTML from the database instead of disk and use the primary key instead of the file path.
I don't understand how this can let you perform a query like: ..MATCH (col1,col2,...) AGAINST (expr ...
Hi!

I´m trying to run LUCENE with FireBird, and have small problem.

IndexWriter writer = new IndexWriter(???, new StandardAnalyzer(), true);

What should be instead of ??? if the IndexWriter should use Firebird (FbDirectory) as a storage place. I didnt find any syntax example. Everywhere there is a sample with file storage.

Thanx for posting small piece of code.

Vaclav
Blog comments are closed.



Previous

Archives