public virtual void TestEquals() { RegexpQuery a1 = new RegexpQuery(new Term(FieldName, "[aA]"), RegExp.NONE); RegexpQuery a2 = new RegexpQuery(new Term(FieldName, "[aA]"), RegExp.NONE); RegexpQuery b = new RegexpQuery(new Term(FieldName, "[bB]"), RegExp.NONE); Assert.AreEqual(a1, a2); Assert.IsFalse(a1.Equals(b)); a1.SetRewriteMethod(new FieldCacheRewriteMethod()); a2.SetRewriteMethod(new FieldCacheRewriteMethod()); b.SetRewriteMethod(new FieldCacheRewriteMethod()); Assert.AreEqual(a1, a2); Assert.IsFalse(a1.Equals(b)); QueryUtils.Check(a1); }
public virtual void TestEquals() { RegexpQuery a1 = new RegexpQuery(new Term(fieldName, "[aA]"), RegExpSyntax.NONE); RegexpQuery a2 = new RegexpQuery(new Term(fieldName, "[aA]"), RegExpSyntax.NONE); RegexpQuery b = new RegexpQuery(new Term(fieldName, "[bB]"), RegExpSyntax.NONE); Assert.AreEqual(a1, a2); Assert.IsFalse(a1.Equals(b)); a1.MultiTermRewriteMethod = (new DocTermOrdsRewriteMethod()); a2.MultiTermRewriteMethod = (new DocTermOrdsRewriteMethod()); b.MultiTermRewriteMethod = (new DocTermOrdsRewriteMethod()); Assert.AreEqual(a1, a2); Assert.IsFalse(a1.Equals(b)); QueryUtils.Check(a1); }
public virtual void TestEquals() { RegexpQuery a1 = new RegexpQuery(new Term(FieldName, "[aA]"), RegExp.NONE); RegexpQuery a2 = new RegexpQuery(new Term(FieldName, "[aA]"), RegExp.NONE); RegexpQuery b = new RegexpQuery(new Term(FieldName, "[bB]"), RegExp.NONE); Assert.AreEqual(a1, a2); Assert.IsFalse(a1.Equals(b)); a1.SetRewriteMethod(new FieldCacheRewriteMethod()); a2.SetRewriteMethod(new FieldCacheRewriteMethod()); b.SetRewriteMethod(new FieldCacheRewriteMethod()); Assert.AreEqual(a1, a2); Assert.IsFalse(a1.Equals(b)); QueryUtils.Check(a1); }