本文整理汇总了C#中Lucene.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Lucene.Get方法的具体用法?C# Lucene.Get怎么用?C# Lucene.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene
的用法示例。
在下文中一共展示了Lucene.Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SbSearchDoc
/// <summary>
/// Load data directly from lucene document
/// </summary>
/// <param name="doc"></param>
public SbSearchDoc(Lucene.Net.Documents.Document doc)
{
ContentTypes = doc.GetValues("type");
Sources = doc.GetValues("source");
Categories = doc.GetValues("category");
try {
LastModified = DateTimeEx.FromUnixTimestamp(Convert.ToInt32(doc.Get("lastmod")));
} catch { LastModified = DateTime.MinValue; }
Title = doc.Get("title");
Keywords = doc.Get("keywords");
Description = doc.Get("desc");
Author = doc.Get("author");
Location = doc.Get("loc");
// PlainContent = doc.Get("content");
}
示例2: SetProperty
public void SetProperty(Lucene.Net.Documents.Document doc)
{
if (doc != null)
{
this.SchoolId = XConvert.ToInt32(doc.Get("SchoolId"), -1);
this.Type = (SchoolType)XConvert.ToByte(doc.Get("Type"));
this.Name = doc.Get("Name");
this.CnName = doc.Get("CnName");
this.Pinyin = doc.Get("Pinyin");
this.RegionId = XConvert.ToInt32(doc.Get("RegionId"), -1);
this.StateId = XConvert.ToInt32(doc.Get("StateId"), -1);
this.CityId = XConvert.ToInt32(doc.Get("CityId"), -1);
}
}
示例3: Hit
/// <summary>
/// ���н�����캯��
/// </summary>
/// <param name="doc">������</param>
/// <param name="offset">�ؼ����������е�λ��</param>
internal Hit(Lucene.Net.Documents.Document doc, int offset)
{
base.id = doc.Get("id");
base.lastIndex = Lucene.Net.Documents.DateField.StringToDate(doc.Get("date"));
//�����ⲿ��ŵ��ĵ�ʵ��
StoreReader story = new StoreReader(Directorys.StoreDirectory + Math.Ceiling(Double.Parse(base.id) / 10000D).ToString("f0") + @"\" + base.id + ".gz");
//��ȡ�ѱ��������ͷ
base.author = story.ReadLine();
base.cat = story.ReadLine();
base.tag = story.ReadLine();
base.title = story.ReadLine();
base.path = story.ReadLine();
int readed = 0;
int len = 126;//��ʾ���ݳ���
char[] block = new char[offset + len];
//��ȡ�������ؼ��ֺ�len���ַ�
readed = story.ReadBlock(block, 0, block.Length);
story.Close();
int index = offset;
//����ؼ��ֲ��ڽ�β����ժҪ��ʼλ�ö�λ�ڹؼ���ǰһ��������֮����ժҪȡĩβ��len���ַ�
if (readed == block.Length)
{
UnicodeCategory category;
for (; index > 0; index--)
{
category = Char.GetUnicodeCategory(Char.ToLower(block[index]));
if (category == UnicodeCategory.OtherPunctuation)
{
index += 1;
break;
}
}
}
else
{
index = Math.Max(0, readed - len);
}
//���ժҪ���ڽ�β�����ں�����ӡ�...��
base.body = (new String(block, index, Math.Min(len - 1, readed))) + ((readed >= index + len) ? "..." : "");
}