Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-465

Error indexing a document end Filed.Store.COMPRESS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Cannot Reproduce
    • Lucene.Net 2.9.4
    • Lucene.Net 2.9.4
    • .NET API
    • Windows 7 x64 Professional, Visual Studio 2010 Ultimate SP1, .NET 4.0, Lucene.net 2.9.4.1, SharpZipLib 0.86.0.518

    Description

      I'm developing a index, and need to store values compressed, because its needed to show that info to the user.
      I've the current error: "Can not load ICSharpCode.SharpZipLib.dll", when I do the "writer.AddDocument(doc);"

      The DLLs are from NuGet.

      Snippet:
      //retirar o directório
      System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(path);
      //criar o directório para o lucene
      Directory directory = FSDirectory.Open(directoryInfo);
      //instanciar o analyser
      Analyzer analyzer = new SnowballAnalyzer("Portuguese");
      //abrir o indíce
      bool isNew = !IndexReader.IndexExists(directory);
      IndexWriter writer = new IndexWriter(directory, analyzer, isNew, Lucene.Net.Index.IndexWriter.MaxFieldLength.UNLIMITED);
      //gravar o documento
      Document doc = new Document();
      NumericField numericField = new NumericField("id", Field.Store.YES, false);
      numericField.SetIntValue(id);
      doc.Add(numericField);
      Field field = new Field("title", title, Field.Store.COMPRESS, Field.Index.ANALYZED);
      field.SetBoost(7);
      doc.Add(field);
      field = new Field("description", tescription, Field.Store.COMPRESS, Field.Index.ANALYZED);
      doc.Add(field);
      writer.AddDocument(doc);
      writer.Optimize();
      //Close the writer
      writer.Commit();
      writer.Close();
      }
      catch (Exception ex)

      { throw ex; }

      Attachments

        Activity

          People

            Unassigned Unassigned
            pmni João Rosa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: