views:

94

answers:

1

Hello All,

How can I create index and then search like in SQL Server FTS?

I.e. data is indexed once and then user can search:

  1. exact matching: "apple", "monkey", "drunk" etc...
  2. forms of words:
    • enter "drunk" and find "drink", "drank", "drunk"
    • enter "apples" and find "apples", "apple"
  3. context: "app*" and find "apple", "application" etc

Is it possible?

thank you!

A: 

Have a look at the Java documentation for Lucene's QueryParser syntax to get a good idea for what is possible. It's more or less the same as the .NET version.

Lucene does support stemming which will match apples and apple, etc.

I've not used full text search in SQL Server for a long time, but I'm fairly sure that Lucene.NET will surpass it.

Sam Doshi
thank you, but what Analyzer I have to use to index documents in this case?It seems PorterStemmer can split rotts of words but it does not know irregular word forms such as drink, drunk, drank etc
Oleg
Try the SnowballAnalyzer?
Sam Doshi