You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by David Ball <da...@webxsystems.com> on 2018/01/09 10:44:48 UTC

AnalyzingInfixSuggester commit

Hi.

Once a lookup has been built using a AnalyzingInfixSuggester, how can it be commited to disk such that it doesn't have to be built again? Old documentation shows a 'Commit' method that has since been removed.

The lookup is built and works fine first time around, but I can't figure out how to reload it.

using (var dir = FSDirectory.Open(_indexDirectory))
           {
                using (var analyzer = new StandardAnalyzer(LuceneVersion.LUCENE_48))
                {
                    var suggester = new AnalyzingInfixSuggester(LuceneVersion.LUCENE_48, dir, analyzer);

                    // Build
                    //suggester.Build(new DocumentIterator(documents.GetEnumerator()));
                }
            }

Kind regards,
David


RE: AnalyzingInfixSuggester commit

Posted by Shad Storhaug <sh...@shadstorhaug.com>.
David,

From your description, it sounds like the Commit method is similar to the Store method: https://lucene.apache.org/core/4_8_0/suggest/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.html

Do note there are examples of usage in the AnalyzingInfixSuggesterTest: https://github.com/apache/lucenenet/blob/a3a12967b250e8e7e5f623f0ba7572ec64f479ac/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingInfixSuggesterTest.cs

Thanks,
Shad Storhaug (NightOwl888)

-----Original Message-----
From: David Ball [mailto:david.ball@webxsystems.com] 
Sent: Tuesday, January 9, 2018 5:45 PM
To: user@lucenenet.apache.org
Subject: AnalyzingInfixSuggester commit
Importance: High

Hi.

Once a lookup has been built using a AnalyzingInfixSuggester, how can it be commited to disk such that it doesn't have to be built again? Old documentation shows a 'Commit' method that has since been removed.

The lookup is built and works fine first time around, but I can't figure out how to reload it.

using (var dir = FSDirectory.Open(_indexDirectory))
           {
                using (var analyzer = new StandardAnalyzer(LuceneVersion.LUCENE_48))
                {
                    var suggester = new AnalyzingInfixSuggester(LuceneVersion.LUCENE_48, dir, analyzer);

                    // Build
                    //suggester.Build(new DocumentIterator(documents.GetEnumerator()));
                }
            }

Kind regards,
David