当前位置: 首页>>代码示例>>C#>>正文


C# SpanTermQuery.Clone方法代码示例

本文整理汇总了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 });
        }
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:14,代码来源:TestBasics.cs

示例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});
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:14,代码来源:TestBasics.cs


注:本文中的Lucene.Net.Search.Spans.SpanTermQuery.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。