You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Adam smalin <ac...@gmail.com> on 2010/06/20 16:21:38 UTC

StartCommit exception under linux

Hi i am using Lucene.NET 2.9.2

This code (bottom) works under windows. But  under ubuntu LTS i get this
exception found in my apache logs.

Stacktrace:

  at Lucene.Net.Index.IndexWriter.StartCommit
(long,System.Collections.Generic.IDictionary`2<string, string>) <0xffffffff>
  at Lucene.Net.Index.IndexWriter.StartCommit
(long,System.Collections.Generic.IDictionary`2<string, string>) <0x004fc>
  at Lucene.Net.Index.IndexWriter.PrepareCommit
(System.Collections.Generic.IDictionary`2<string, string>,bool) <0x00079>
  at Lucene.Net.Index.IndexWriter.Commit
(System.Collections.Generic.IDictionary`2<string, string>) <0x0009a>
  at Lucene.Net.Index.IndexWriter.Commit () <0x00012>

My code is

        public static void init()
        {
            bool create = false;
            string dirname = "LuceneIndex_a";
            if (System.IO.Directory.Exists(dirname) == false)
                create = true;

            directory = FSDirectory.Open(new DirectoryInfo(dirname));
            analyzer = new
StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29);
            writer = new IndexWriter(directory, analyzer, create, new
IndexWriter.MaxFieldLength(int.MaxValue));
        }

then i loop through this several times.

        static public void AddToDoc(long mediaId, string title, string desc,
string tags) // IEnumerable<string> tags)
        {
            var t = new Term("id", mediaId.ToString());
            writer.UpdateDocument(t, MakeDoc(mediaId, title, desc, tags));
            writer.Commit();
        }

What can i do to solve this?

Re: StartCommit exception under linux

Posted by Robert Jordan <ro...@gmx.net>.
On 20.06.2010 16:21, Adam smalin wrote:
> Hi i am using Lucene.NET 2.9.2
>
> This code (bottom) works under windows. But  under ubuntu LTS i get this
> exception found in my apache logs.

Which Mono version are you using? (output of "mono -V").

Robert