Beispiel #1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (!base.Equals(obj))
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            var other = (MoreLikeThisQuery)obj;

            if (Analyzer == null)
            {
                if (other.Analyzer != null)
                {
                    return(false);
                }
            }
            else if (!Analyzer.Equals(other.Analyzer))
            {
                return(false);
            }
            if (fieldName == null)
            {
                if (other.fieldName != null)
                {
                    return(false);
                }
            }
            else if (!fieldName.Equals(other.fieldName))
            {
                return(false);
            }
            if (LikeText == null)
            {
                if (other.LikeText != null)
                {
                    return(false);
                }
            }
            else if (!LikeText.Equals(other.LikeText))
            {
                return(false);
            }
            if (MaxQueryTerms != other.MaxQueryTerms)
            {
                return(false);
            }
            if (MinDocFreq != other.MinDocFreq)
            {
                return(false);
            }
            if (MinTermFrequency != other.MinTermFrequency)
            {
                return(false);
            }
            if (!Arrays.Equals(MoreLikeFields, other.MoreLikeFields))
            {
                return(false);
            }
            if (Number.FloatToIntBits(PercentTermsToMatch) != Number.FloatToIntBits(other.PercentTermsToMatch))
            {
                return(false);
            }
            if (StopWords == null)
            {
                if (other.StopWords != null)
                {
                    return(false);
                }
            }
            else if (!StopWords.Equals(other.StopWords))
            {
                return(false);
            }
            return(true);
        }