public void CreateDateTimeKeywordField() { FieldAdapter keyword = FieldAdapter.CreateKeywordField("Name", DateTime.Now); Assert.AreEqual("Name", keyword.Name); Assert.IsFalse(keyword.IsTokenized); Assert.IsTrue(keyword.IsIndexed); Assert.IsTrue(keyword.IsStored); }
public void CreateUnstoredField() { FieldAdapter unstored = FieldAdapter.CreateUnstoredField("Name", "Value"); Assert.AreEqual("Name", unstored.Name); Assert.AreEqual("Value", unstored.StringValue); Assert.IsTrue(unstored.IsTokenized); Assert.IsTrue(unstored.IsIndexed); Assert.IsFalse(unstored.IsStored); }
public void CreateTextField() { FieldAdapter text = FieldAdapter.CreateTextField("Name", "Value"); Assert.AreEqual("Name", text.Name); Assert.AreEqual("Value", text.StringValue); Assert.IsTrue(text.IsTokenized); Assert.IsTrue(text.IsIndexed); Assert.IsTrue(text.IsStored); }
public void CreateKeywordField() { FieldAdapter keyword = FieldAdapter.CreateKeywordField("Name", "Value"); Assert.AreEqual("Name", keyword.Name); Assert.AreEqual("Value", keyword.StringValue); Assert.IsFalse(keyword.IsTokenized); Assert.IsTrue(keyword.IsIndexed); Assert.IsTrue(keyword.IsStored); }
public void Boost() { Field field = Field.Keyword("Name", "Value"); FieldAdapter fieldAdapter = new FieldAdapter(field); Assert.AreEqual(field.GetBoost(), fieldAdapter.Boost); fieldAdapter.Boost = 0.7f; Assert.AreEqual(0.7f, fieldAdapter.Boost); Assert.AreEqual(field.GetBoost(), fieldAdapter.Boost); }
public void CreateReaderTextField() { TextReader textReader = new StringReader(string.Empty); FieldAdapter text = FieldAdapter.CreateTextField("Name", textReader); Assert.AreEqual("Name", text.Name); Assert.AreSame(textReader, text.ReaderValue); Assert.IsTrue(text.IsTokenized); Assert.IsTrue(text.IsIndexed); Assert.IsFalse(text.IsStored); }
public void Add <T>(string fieldType, FieldAdapter <T> adapter) where T : class { Add(fieldType, adapter); }