public static WriteDoc ( |
||
random | ||
dir | Directory | |
analyzer | Analyzer | |
similarity | Similarity | |
doc | Lucene.Net.Documents.Document | |
Résultat | Lucene.Net.Index.SegmentCommitInfo |
public virtual void TestDelete() { Document docToDelete = new Document(); DocHelper.SetupDoc(docToDelete); DocHelper.WriteDoc(dir, "seg-to-delete", docToDelete); try { SegmentReader deleteReader = new SegmentReader(new SegmentInfo("seg-to-delete", 1, dir)); Assert.IsTrue(deleteReader != null); Assert.IsTrue(deleteReader.NumDocs() == 1); deleteReader.Delete(0); Assert.IsTrue(deleteReader.IsDeleted(0) == true); Assert.IsTrue(deleteReader.HasDeletions() == true); Assert.IsTrue(deleteReader.NumDocs() == 0); try { Document test = deleteReader.Document(0); Assert.IsTrue(false); } catch (System.ArgumentException e) { Assert.IsTrue(true); } } catch (System.IO.IOException e) { System.Console.Error.WriteLine(e.StackTrace); Assert.IsTrue(false); } }
public override void SetUp() { base.SetUp(); Dir = NewDirectory(); DocHelper.SetupDoc(TestDoc); Info = DocHelper.WriteDoc(Random(), Dir, TestDoc); }
public override void SetUp() { base.SetUp(); DocHelper.SetupDoc(testDoc); SegmentInfo info = DocHelper.WriteDoc(dir, testDoc); reader = SegmentReader.Get(info); }
public override void SetUp() { base.SetUp(); testDoc = new Document(); dir = NewDirectory(); DocHelper.SetupDoc(testDoc); info = DocHelper.WriteDoc(Random, dir, testDoc); }
public override void SetUp() { base.SetUp(); DocHelper.SetupDoc(testDoc); SegmentInfo info = DocHelper.WriteDoc(dir, testDoc); reader = SegmentReader.Get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR, null); }
public override void SetUp() { base.SetUp(); Dir = NewDirectory(); DocHelper.SetupDoc(TestDoc); SegmentCommitInfo info = DocHelper.WriteDoc(Random(), Dir, TestDoc); Reader = new SegmentReader(info, DirectoryReader.DEFAULT_TERMS_INDEX_DIVISOR, IOContext.READ); }
public virtual void TestIndexDivisor() { TestDoc = new Document(); DocHelper.SetupDoc(TestDoc); DocHelper.WriteDoc(Random(), Dir, TestDoc); TestTermDocs(2); TestBadSeek(2); TestSkipTo(2); }
public virtual void TestIndexDivisor() { dir = new MockRAMDirectory(); testDoc = new Document(); DocHelper.SetupDoc(testDoc); DocHelper.WriteDoc(dir, testDoc); TestTermDocs(2); testBadSeek(2); testSkipTo(2); }
protected virtual void SetUp() { try { DocHelper.SetupDoc(testDoc); DocHelper.WriteDoc(dir, testDoc); reader = new SegmentReader(new SegmentInfo("test", 1, dir)); } catch (System.IO.IOException e) { } }
public override void SetUp() { base.SetUp(); DocHelper.SetupDoc(doc1); SegmentInfo info1 = DocHelper.WriteDoc(merge1Dir, doc1); DocHelper.SetupDoc(doc2); SegmentInfo info2 = DocHelper.WriteDoc(merge2Dir, doc2); reader1 = SegmentReader.Get(info1); reader2 = SegmentReader.Get(info2); }
public override void SetUp() { base.SetUp(); DocHelper.SetupDoc(doc1); SegmentInfo info1 = DocHelper.WriteDoc(merge1Dir, doc1); DocHelper.SetupDoc(doc2); SegmentInfo info2 = DocHelper.WriteDoc(merge2Dir, doc2); reader1 = SegmentReader.Get(true, info1, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR, null); reader2 = SegmentReader.Get(true, info2, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR, null); }
public override void SetUp() { base.SetUp(); dir = new RAMDirectory(); doc1 = new Document(); doc2 = new Document(); DocHelper.SetupDoc(doc1); DocHelper.SetupDoc(doc2); DocHelper.WriteDoc(dir, doc1); DocHelper.WriteDoc(dir, doc2); sis = new SegmentInfos(); sis.Read(dir); }
public override void SetUp() { base.SetUp(); MergedDir = NewDirectory(); Merge1Dir = NewDirectory(); Merge2Dir = NewDirectory(); DocHelper.SetupDoc(Doc1); SegmentCommitInfo info1 = DocHelper.WriteDoc(Random(), Merge1Dir, Doc1); DocHelper.SetupDoc(Doc2); SegmentCommitInfo info2 = DocHelper.WriteDoc(Random(), Merge2Dir, Doc2); Reader1 = new SegmentReader(info1, DirectoryReader.DEFAULT_TERMS_INDEX_DIVISOR, NewIOContext(Random())); Reader2 = new SegmentReader(info2, DirectoryReader.DEFAULT_TERMS_INDEX_DIVISOR, NewIOContext(Random())); }
public virtual void TestDelete() { Document docToDelete = new Document(); DocHelper.SetupDoc(docToDelete); SegmentInfo info = DocHelper.WriteDoc(dir, docToDelete); SegmentReader deleteReader = SegmentReader.Get(false, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR, null); Assert.IsTrue(deleteReader != null); Assert.IsTrue(deleteReader.NumDocs() == 1); deleteReader.DeleteDocument(0, null); Assert.IsTrue(deleteReader.IsDeleted(0) == true); Assert.IsTrue(deleteReader.HasDeletions == true); Assert.IsTrue(deleteReader.NumDocs() == 0); }
public virtual void TestDelete() { Document docToDelete = new Document(); DocHelper.SetupDoc(docToDelete); SegmentInfo info = DocHelper.WriteDoc(dir, docToDelete); SegmentReader deleteReader = SegmentReader.Get(info); Assert.IsTrue(deleteReader != null); Assert.IsTrue(deleteReader.NumDocs() == 1); deleteReader.DeleteDocument(0); Assert.IsTrue(deleteReader.IsDeleted(0) == true); Assert.IsTrue(deleteReader.HasDeletions() == true); Assert.IsTrue(deleteReader.NumDocs() == 0); }
protected virtual void SetUp() { DocHelper.SetupDoc(doc1); DocHelper.WriteDoc(merge1Dir, merge1Segment, doc1); DocHelper.SetupDoc(doc2); DocHelper.WriteDoc(merge2Dir, merge2Segment, doc2); try { reader1 = new SegmentReader(new SegmentInfo(merge1Segment, 1, merge1Dir)); reader2 = new SegmentReader(new SegmentInfo(merge2Segment, 1, merge2Dir)); } catch (System.IO.IOException e) { System.Console.Error.WriteLine(e.StackTrace); } }
protected virtual void SetUp() { DocHelper.SetupDoc(doc1); DocHelper.SetupDoc(doc2); DocHelper.WriteDoc(dir, "seg-1", doc1); DocHelper.WriteDoc(dir, "seg-2", doc2); try { sis.Write(dir); reader1 = new SegmentReader(new SegmentInfo("seg-1", 1, dir)); reader2 = new SegmentReader(new SegmentInfo("seg-2", 1, dir)); readers[0] = reader1; readers[1] = reader2; } catch (System.IO.IOException e) { System.Console.Error.WriteLine(e.StackTrace); } }
protected virtual void SetUp() { DocHelper.SetupDoc(testDoc); DocHelper.WriteDoc(dir, testDoc); }
public override void SetUp() { base.SetUp(); DocHelper.SetupDoc(testDoc); info = DocHelper.WriteDoc(dir, testDoc); }