本文整理汇总了C#中Lucene.Net.Search.Spans.SpanNearQuery.GetClauses方法的典型用法代码示例。如果您正苦于以下问题:C# SpanNearQuery.GetClauses方法的具体用法?C# SpanNearQuery.GetClauses怎么用?C# SpanNearQuery.GetClauses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.Spans.SpanNearQuery
的用法示例。
在下文中一共展示了SpanNearQuery.GetClauses方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NearSpansOrdered
public NearSpansOrdered(SpanNearQuery spanNearQuery, IndexReader reader)
{
InitBlock();
if (spanNearQuery.GetClauses().Length < 2)
{
throw new System.ArgumentException("Less than 2 clauses: " + spanNearQuery);
}
allowedSlop = spanNearQuery.GetSlop();
SpanQuery[] clauses = spanNearQuery.GetClauses();
subSpans = new PayloadSpans[clauses.Length];
matchPayload = new List<byte[]>();
subSpansByDoc = new PayloadSpans[clauses.Length];
for (int i = 0; i < clauses.Length; i++)
{
subSpans[i] = clauses[i].GetPayloadSpans(reader);
subSpansByDoc[i] = subSpans[i]; // used in toSameDoc()
}
query = spanNearQuery; // kept for toString() only.
}
示例2: NearSpansUnordered
private int totalLength; // sum of current lengths
#endregion Fields
#region Constructors
public NearSpansUnordered(SpanNearQuery query, IndexReader reader)
{
this.query = query;
this.slop = query.GetSlop();
SpanQuery[] clauses = query.GetClauses();
queue = new CellQueue(this, clauses.Length);
for (int i = 0; i < clauses.Length; i++)
{
SpansCell cell = new SpansCell(this, clauses[i].GetPayloadSpans(reader), i);
ordered.Add(cell);
}
}
示例3: VisitQuery
private static void VisitQuery(SpanNearQuery query, AzureQueryLogger.IndentedTextWriter writer)
{
writer.WriteLine("IsInOrder: {0}", (query.IsInOrder ? 1 : 0));
writer.WriteLine("Slop: {0}", (object)query.Slop);
AzureQueryLogger.VisitClauses(writer, query.GetClauses());
}
示例4: NearSpans
public NearSpans(SpanNearQuery query, IndexReader reader)
{
this.query = query;
this.slop = query.GetSlop();
this.inOrder = query.IsInOrder();
SpanQuery[] clauses = query.GetClauses(); // initialize spans & list
queue = new CellQueue(this, clauses.Length);
for (int i = 0; i < clauses.Length; i++)
{
SpansCell cell = new SpansCell(this, clauses[i].GetSpans(reader), i);
ordered.Add(cell); // add to ordered
}
}