本文整理汇总了C#中Lucene.Net.Search.MultiPhraseQuery.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# MultiPhraseQuery.Equals方法的具体用法?C# MultiPhraseQuery.Equals怎么用?C# MultiPhraseQuery.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.MultiPhraseQuery
的用法示例。
在下文中一共展示了MultiPhraseQuery.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestHashCodeAndEquals
public virtual void TestHashCodeAndEquals()
{
MultiPhraseQuery query1 = new MultiPhraseQuery();
MultiPhraseQuery query2 = new MultiPhraseQuery();
Assert.AreEqual(query1.GetHashCode(), query2.GetHashCode());
Assert.AreEqual(query1, query2);
Term term1 = new Term("someField", "someText");
query1.Add(term1);
query2.Add(term1);
Assert.AreEqual(query1.GetHashCode(), query2.GetHashCode());
Assert.AreEqual(query1, query2);
Term term2 = new Term("someField", "someMoreText");
query1.Add(term2);
Assert.IsFalse(query1.GetHashCode() == query2.GetHashCode());
Assert.IsFalse(query1.Equals(query2));
query2.Add(term2);
Assert.AreEqual(query1.GetHashCode(), query2.GetHashCode());
Assert.AreEqual(query1, query2);
}