本文整理汇总了C#中Lucene.Net.Documents.Field.IsTokenized方法的典型用法代码示例。如果您正苦于以下问题:C# Field.IsTokenized方法的具体用法?C# Field.IsTokenized怎么用?C# Field.IsTokenized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Documents.Field
的用法示例。
在下文中一共展示了Field.IsTokenized方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBinaryField
public virtual void TestBinaryField()
{
Document doc = new Document();
Fieldable stringFld = new Field("string", binaryVal, Field.Store.YES, Field.Index.NO);
Fieldable binaryFld = new Field("binary", System.Text.UTF8Encoding.UTF8.GetBytes(binaryVal), Field.Store.YES);
Fieldable binaryFld2 = new Field("binary", System.Text.UTF8Encoding.UTF8.GetBytes(binaryVal2), Field.Store.YES);
doc.Add(stringFld);
doc.Add(binaryFld);
Assert.AreEqual(2, doc.fields_ForNUnit.Count);
Assert.IsTrue(binaryFld.IsBinary());
Assert.IsTrue(binaryFld.IsStored());
Assert.IsFalse(binaryFld.IsIndexed());
Assert.IsFalse(binaryFld.IsTokenized());
System.String binaryTest = new System.String(System.Text.UTF8Encoding.UTF8.GetChars(doc.GetBinaryValue("binary")));
Assert.IsTrue(binaryTest.Equals(binaryVal));
System.String stringTest = doc.Get("string");
Assert.IsTrue(binaryTest.Equals(stringTest));
doc.Add(binaryFld2);
Assert.AreEqual(3, doc.fields_ForNUnit.Count);
byte[][] binaryTests = doc.GetBinaryValues("binary");
Assert.AreEqual(2, binaryTests.Length);
binaryTest = new System.String(System.Text.UTF8Encoding.UTF8.GetChars(binaryTests[0]));
System.String binaryTest2 = new System.String(System.Text.UTF8Encoding.UTF8.GetChars(binaryTests[1]));
Assert.IsFalse(binaryTest.Equals(binaryTest2));
Assert.IsTrue(binaryTest.Equals(binaryVal));
Assert.IsTrue(binaryTest2.Equals(binaryVal2));
doc.RemoveField("string");
Assert.AreEqual(2, doc.fields_ForNUnit.Count);
doc.RemoveFields("binary");
Assert.AreEqual(0, doc.fields_ForNUnit.Count);
}
示例2: AddFieldRow
private void AddFieldRow(string fieldName, Field f)
{
string feature;
ListViewItem item = new ListViewItem("<" + fieldName + ">");
if (f != null && f.IsIndexed()) feature = "+";
else feature = " ";
item.SubItems.Add(feature);
if (f != null && f.IsTokenized()) feature = "+";
else feature = " ";
item.SubItems.Add(feature);
if (f != null && f.IsStored()) feature = "+";
else feature = " ";
item.SubItems.Add(feature);
if (f != null && f.IsTermVectorStored()) feature = "+";
else feature = " ";
item.SubItems.Add(feature);
if (f != null)
item.SubItems.Add(f.GetBoost().ToString("0.0####"));
else item.SubItems.Add("");
if (f != null)
item.SubItems.Add(f.StringValue());
else
{
item.SubItems.Add(_luke.resources.GetString("FieldNotAvailable"));
}
listDocFields.Items.Add(item);
}