Exemplo n.º 1
0
        public override sealed bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (!(o is DocTermOrdsRangeFilter))
            {
                return(false);
            }
            DocTermOrdsRangeFilter other = (DocTermOrdsRangeFilter)o;

            if (!this.Field_Renamed.Equals(other.Field_Renamed) || this.IncludeLower != other.IncludeLower || this.IncludeUpper != other.IncludeUpper)
            {
                return(false);
            }
            if (this.LowerVal_Renamed != null ? !this.LowerVal_Renamed.Equals(other.LowerVal_Renamed) : other.LowerVal_Renamed != null)
            {
                return(false);
            }
            if (this.UpperVal_Renamed != null ? !this.UpperVal_Renamed.Equals(other.UpperVal_Renamed) : other.UpperVal_Renamed != null)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        public override sealed bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (!(o is DocTermOrdsRangeFilter))
            {
                return(false);
            }
            DocTermOrdsRangeFilter other = (DocTermOrdsRangeFilter)o;

            if (!this.field.Equals(other.field, StringComparison.Ordinal) || this.includeLower != other.includeLower || this.includeUpper != other.includeUpper)
            {
                return(false);
            }
            if (this.lowerVal != null ? !this.lowerVal.Equals(other.lowerVal) : other.lowerVal != null)
            {
                return(false);
            }
            if (this.upperVal != null ? !this.upperVal.Equals(other.upperVal) : other.upperVal != null)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// check that the # of hits is the same as if the query
        /// is run against the inverted index
        /// </summary>
        protected internal virtual void AssertSame(BytesRef lowerVal, BytesRef upperVal, bool includeLower, bool includeUpper)
        {
            Query          docValues = new ConstantScoreQuery(DocTermOrdsRangeFilter.NewBytesRefRange(fieldName, lowerVal, upperVal, includeLower, includeUpper));
            MultiTermQuery inverted  = new TermRangeQuery(fieldName, lowerVal, upperVal, includeLower, includeUpper);

            inverted.MultiTermRewriteMethod = (MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);

            TopDocs invertedDocs  = searcher1.Search(inverted, 25);
            TopDocs docValuesDocs = searcher2.Search(docValues, 25);

            CheckHits.CheckEqual(inverted, invertedDocs.ScoreDocs, docValuesDocs.ScoreDocs);
        }