public override bool Equals(object o)
        {
            if (!(o is FieldMaskingSpanQuery))
            {
                return(false);
            }
            FieldMaskingSpanQuery other = (FieldMaskingSpanQuery)o;

            return(this.Field.Equals(other.Field, StringComparison.Ordinal) && (this.Boost == other.Boost) && this.MaskedQuery.Equals(other.MaskedQuery));
        }
        public override bool Equals(object o)
        {
            if (!(o is FieldMaskingSpanQuery))
            {
                return(false);
            }
            FieldMaskingSpanQuery other = (FieldMaskingSpanQuery)o;

            // LUCENENET specific - compare bits rather than using equality operators to prevent these comparisons from failing in x86 in .NET Framework with optimizations enabled
            return(this.Field.Equals(other.Field, StringComparison.Ordinal) &&
                   (NumericUtils.SingleToSortableInt32(this.Boost) == NumericUtils.SingleToSortableInt32(other.Boost)) &&
                   this.MaskedQuery.Equals(other.MaskedQuery));
        }
        public override Query Rewrite(IndexReader reader)
        {
            FieldMaskingSpanQuery clone = null;

            SpanQuery rewritten = (SpanQuery)maskedQuery.Rewrite(reader);

            if (rewritten != maskedQuery)
            {
                clone             = (FieldMaskingSpanQuery)this.Clone();
                clone.maskedQuery = rewritten;
            }

            if (clone != null)
            {
                return(clone);
            }
            else
            {
                return(this);
            }
        }