Ejemplo n.º 1
0
            protected override void Context()
            {
                var dir = new SimpleFSDirectory(new DirectoryInfo(TempDirectory), new NoLockFactory());
                var analyzer = new StandardAnalyzer(Version.LUCENE_20);
                var maxFieldLength = new IndexWriter.MaxFieldLength(200);

                var index = new FluentIndexWriter<TestObject>(dir, analyzer, maxFieldLength);
                var data = new TestObject() { Id = Guid.NewGuid(), LongId = 123, ValidProperty = "Property", IgnoredProperty = "Ignored" };
                var data2 = new TestObject() { Id = Guid.Empty, LongId = 123456, ValidProperty = "Abc def ghij", IgnoredProperty = "Ignored" };

                index.AddDocument(data);
                index.AddDocument(data2);

                index.Commit();
            }
Ejemplo n.º 2
0
            protected override void Context()
            {
                var dir            = new SimpleFSDirectory(new DirectoryInfo(TempDirectory), new NoLockFactory());
                var analyzer       = new StandardAnalyzer(Version.LUCENE_20);
                var maxFieldLength = new IndexWriter.MaxFieldLength(200);

                var index = new FluentIndexWriter <TestObject>(dir, analyzer, maxFieldLength);
                var data  = new TestObject()
                {
                    Id = Guid.NewGuid(), LongId = 123, ValidProperty = "Property", IgnoredProperty = "Ignored"
                };
                var data2 = new TestObject()
                {
                    Id = Guid.Empty, LongId = 123456, ValidProperty = "Abc def ghij", IgnoredProperty = "Ignored"
                };

                index.AddDocument(data);
                index.AddDocument(data2);

                index.Commit();
            }