Example #1
0
 public void IndexRecordOptionWorks(IndexRecordOption indexRecordOptions)
 {
     using (var value = new TextFieldIndexing())
     {
         value.IndexRecordOptions = indexRecordOptions;
         Assert.Equal(indexRecordOptions, value.IndexRecordOptions);
     }
 }
Example #2
0
 public void TokenizerWorks(string tokenizer)
 {
     using (var value = new TextFieldIndexing())
     {
         value.Tokenizer = tokenizer;
         Assert.Equal(tokenizer, value.Tokenizer);
     }
 }
Example #3
0
 public void DefaultsWork()
 {
     using (var value = new TextFieldIndexing())
     {
         Assert.Equal(DefaultTokenizers.Default, value.Tokenizer);
         Assert.Equal(IndexRecordOption.Basic, value.IndexRecordOptions);
         Assert.Null(value.TextOptions);
     }
 }
        public IndexWriterTests()
        {
            using (var builder = new SchemaBuilder())
            {
                using (var primaryKeyOptions = new IntOptions().Stored().Fast(Cardinality.SingleValue).Indexed())
                {
                    Id = builder.AddI64Field(nameof(Id), primaryKeyOptions);
                }

                using (var textFieldOptions = new TextFieldIndexing {
                    Tokenizer = DefaultTokenizers.EnglishStemming
                })
                    using (var textOptions = new TextOptions {
                        IndexingOptions = textFieldOptions
                    })
                    {
                        Text = builder.AddTextField(nameof(Text), textOptions);
                    }

                Index = Index.CreateInRam(builder.Build());
            }
        }