本文整理汇总了C#中Lucene.Net.Search.Spans.SpanTermQuery.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# SpanTermQuery.Clone方法的具体用法?C# SpanTermQuery.Clone怎么用?C# SpanTermQuery.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.Spans.SpanTermQuery
的用法示例。
在下文中一共展示了SpanTermQuery.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestNpeInSpanNearInSpanFirstInSpanNot
public virtual void TestNpeInSpanNearInSpanFirstInSpanNot()
{
int n = 5;
SpanTermQuery hun = new SpanTermQuery(new Term("field", "hundred"));
SpanTermQuery term40 = new SpanTermQuery(new Term("field", "forty"));
SpanTermQuery term40c = (SpanTermQuery)term40.Clone();
SpanFirstQuery include = new SpanFirstQuery(term40, n);
SpanNearQuery near = new SpanNearQuery(new SpanQuery[] { hun, term40c }, n - 1, true);
SpanFirstQuery exclude = new SpanFirstQuery(near, n - 1);
SpanNotQuery q = new SpanNotQuery(include, exclude);
CheckHits(q, new int[] { 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949 });
}
示例2: TestNpeInSpanNearInSpanFirstInSpanNot
public virtual void TestNpeInSpanNearInSpanFirstInSpanNot()
{
int n = 5;
SpanTermQuery hun = new SpanTermQuery(new Term("field", "hundred"));
SpanTermQuery term40 = new SpanTermQuery(new Term("field", "forty"));
SpanTermQuery term40c = (SpanTermQuery) term40.Clone();
SpanFirstQuery include = new SpanFirstQuery(term40, n);
SpanNearQuery near = new SpanNearQuery(new SpanQuery[]{hun, term40c}, n - 1, true);
SpanFirstQuery exclude = new SpanFirstQuery(near, n - 1);
SpanNotQuery q = new SpanNotQuery(include, exclude);
CheckHits(q, new int[]{40, 41, 42, 43, 44, 45, 46, 47, 48, 49});
}