B
B
Bartez2011-05-03 05:23:38
.NET
Bartez, 2011-05-03 05:23:38

Question about Lucene.net?

We need a working example of a search taking into account word forms on the Lucene.net engine.
Those. so that the query "cars" would find "car".
You can use the simplest example, you can only for the English language - the main thing is that it works!
Rummaged all Google. I 'm f**king with the code for several hours, either the search for word forms does not work, or I hit the internal Exceptions of Lucene.net itself.
Apparently I'm doing something wrong, but I can't figure it out.
I will be glad for any help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mark_ablov, 2011-05-03
@mark_ablov

it's called stemming.
see - stackoverflow.com/questions/1192671/how-to-enable-stemming-when-searching-using-lucene-net
I myself did not do this for lucene, but for solra it happened.

V
vit256, 2013-11-28
@vit256

You need to use SnowballAnalyzer. A simple indexing example:
Analyzer analyzer = new SnowballAnalyzer(Version.LUCENE_34, "Russian", StopAnalyzer.ENGLISH_STOP_WORDS_SET);
IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_34, analyzer);
IndexWriter writer = new IndexWriter(dir, config);
Document doc = new Document();
...
writer.addDocument(doc);
Here is another link:
http://stackoverflow.com/questions/5391840/stemming-english-words-with-lucene

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question