本文整理汇总了C#中Lucene.Net.Search.Query.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Query.Clone方法的具体用法?C# Query.Clone怎么用?C# Query.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.Query
的用法示例。
在下文中一共展示了Query.Clone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BoostingQuery
private readonly Query match; // query to match
#endregion Fields
#region Constructors
public BoostingQuery(Query match, Query context, float boost)
{
this.match = match;
this.context = (Query) context.Clone(); // clone before boost
this.boost = boost;
this.context.Boost = 0.0f; // ignore context-only matches
}
示例2: CheckHashEquals
/// <summary>
/// check very basic hashCode and equals </summary>
public static void CheckHashEquals(Query q)
{
Query q2 = (Query)q.Clone();
CheckEqual(q, q2);
Query q3 = (Query)q.Clone();
q3.Boost = 7.21792348f;
CheckUnequal(q, q3);
// test that a class check is done so that no exception is thrown
// in the implementation of equals()
Query whacky = new QueryAnonymousInnerClassHelper();
whacky.Boost = q.Boost;
CheckUnequal(q, whacky);
// null test
Assert.IsFalse(q.Equals(null));
}
示例3: CheckHashEquals
/// <summary>check very basic hashCode and equals </summary>
public static void CheckHashEquals(Query q)
{
Query q2 = (Query) q.Clone();
CheckEqual(q, q2);
Query q3 = (Query) q.Clone();
q3.SetBoost(7.21792348f);
CheckUnequal(q, q3);
// test that a class check is done so that no exception is thrown
// in the implementation of equals()
Query whacky = new AnonymousClassQuery();
whacky.SetBoost(q.GetBoost());
CheckUnequal(q, whacky);
}
示例4: Check
public static void Check(Random random, Query q1, IndexSearcher s, bool wrap)
{
try
{
Check(q1);
if (s != null)
{
CheckFirstSkipTo(q1, s);
CheckSkipTo(q1, s);
if (wrap)
{
Check(random, q1, WrapUnderlyingReader(random, s, -1), false);
Check(random, q1, WrapUnderlyingReader(random, s, 0), false);
Check(random, q1, WrapUnderlyingReader(random, s, +1), false);
}
CheckExplanations(q1, s);
Query q2 = (Query)q1.Clone();
CheckEqual(s.Rewrite(q1), s.Rewrite(q2));
}
}
catch (IOException e)
{
throw new Exception(e.Message, e);
}
}
示例5: Check
private static void Check(Query q1, Searcher s, bool wrap)
{
try
{
Check(q1);
if (s != null)
{
if (s is IndexSearcher)
{
IndexSearcher is_Renamed = (IndexSearcher) s;
CheckFirstSkipTo(q1, is_Renamed);
CheckSkipTo(q1, is_Renamed);
if (wrap)
{
Check(q1, WrapUnderlyingReader(is_Renamed, - 1), false);
Check(q1, WrapUnderlyingReader(is_Renamed, 0), false);
Check(q1, WrapUnderlyingReader(is_Renamed, + 1), false);
}
}
if (wrap)
{
Check(q1, WrapSearcher(s, - 1), false);
Check(q1, WrapSearcher(s, 0), false);
Check(q1, WrapSearcher(s, + 1), false);
}
CheckExplanations(q1, s);
CheckSerialization(q1, s);
Query q2 = (Query) q1.Clone();
CheckEqual(s.Rewrite(q1), s.Rewrite(q2));
}
}
catch (System.IO.IOException e)
{
throw new System.SystemException("", e);
}
}