Пример #1
0
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     buffer.Append("*:*");
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #2
0
 /// <summary>Prints a user-readable version of this query. </summary>
 public override System.String ToString(System.String s)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     buffer.Append("filtered(");
     buffer.Append(query.ToString(s));
     buffer.Append(")->");
     buffer.Append(filter);
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #3
0
        /// <summary>Prints a user-readable version of this query. </summary>
        public override System.String ToString(System.String f)
        {
            System.Text.StringBuilder buffer = new System.Text.StringBuilder();
            if (!field.Equals(f))
            {
                buffer.Append(field);
                buffer.Append(":");
            }

            buffer.Append("\"");
            System.Collections.IEnumerator i = termArrays.GetEnumerator();
            bool first = true;

            while (i.MoveNext())
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    buffer.Append(" ");
                }

                Term[] terms = (Term[])i.Current;
                if (terms.Length > 1)
                {
                    buffer.Append("(");
                    for (int j = 0; j < terms.Length; j++)
                    {
                        buffer.Append(terms[j].Text());
                        if (j < terms.Length - 1)
                        {
                            buffer.Append(" ");
                        }
                    }
                    buffer.Append(")");
                }
                else
                {
                    buffer.Append(terms[0].Text());
                }
            }
            buffer.Append("\"");

            if (slop != 0)
            {
                buffer.Append("~");
                buffer.Append(slop);
            }

            buffer.Append(ToStringUtils.Boost(GetBoost()));

            return(buffer.ToString());
        }
Пример #4
0
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     buffer.Append("spanFirst(");
     buffer.Append(match.ToString(field));
     buffer.Append(", ");
     buffer.Append(end);
     buffer.Append(")");
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #5
0
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     buffer.Append("mask(");
     buffer.Append(maskedQuery.ToString(field));
     buffer.Append(")");
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     buffer.Append(" as ");
     buffer.Append(this.field);
     return(buffer.ToString());
 }
Пример #6
0
        /// <summary>Prints a user-readable version of this query. </summary>
        public override System.String ToString(System.String f)
        {
            System.Text.StringBuilder buffer = new System.Text.StringBuilder();
            if (field != null && !field.Equals(f))
            {
                buffer.Append(field);
                buffer.Append(":");
            }

            buffer.Append("\"");
            System.String[] pieces = new System.String[maxPosition + 1];
            for (int i = 0; i < terms.Count; i++)
            {
                int           pos = ((System.Int32)positions[i]);
                System.String s   = pieces[pos];
                if (s == null)
                {
                    s = ((Term)terms[i]).Text();
                }
                else
                {
                    s = s + "|" + ((Term)terms[i]).Text();
                }
                pieces[pos] = s;
            }
            for (int i = 0; i < pieces.Length; i++)
            {
                if (i > 0)
                {
                    buffer.Append(' ');
                }
                System.String s = pieces[i];
                if (s == null)
                {
                    buffer.Append('?');
                }
                else
                {
                    buffer.Append(s);
                }
            }
            buffer.Append("\"");

            if (slop != 0)
            {
                buffer.Append("~");
                buffer.Append(slop);
            }

            buffer.Append(ToStringUtils.Boost(GetBoost()));

            return(buffer.ToString());
        }
Пример #7
0
 /// <summary>Prints a user-readable version of this query. </summary>
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     if (!term.Field().Equals(field))
     {
         buffer.Append(term.Field());
         buffer.Append(":");
     }
     buffer.Append(term.Text());
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #8
0
 /* (non-Javadoc) @see Mono.Lucene.Net.Search.Query#toString(java.lang.String) */
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder(Name()).Append("(");
     sb.Append(subQuery.ToString(field));
     for (int i = 0; i < valSrcQueries.Length; i++)
     {
         sb.Append(", ").Append(valSrcQueries[i].ToString(field));
     }
     sb.Append(")");
     sb.Append(strict?" STRICT":"");
     return(sb.ToString() + ToStringUtils.Boost(GetBoost()));
 }
Пример #9
0
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     if (!term.Field().Equals(field))
     {
         buffer.Append(term.Field());
         buffer.Append(":");
     }
     buffer.Append(term.Text());
     buffer.Append('~');
     buffer.Append(SupportClass.Single.ToString(minimumSimilarity));
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #10
0
 /// <summary>Prints a user-readable version of this query. </summary>
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     if (!GetField().Equals(field))
     {
         buffer.Append(GetField());
         buffer.Append(":");
     }
     buffer.Append(includeLower?'[':'{');
     buffer.Append(lowerTerm != null?lowerTerm:"*");
     buffer.Append(" TO ");
     buffer.Append(upperTerm != null?upperTerm:"*");
     buffer.Append(includeUpper?']':'}');
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #11
0
        public override System.String ToString(System.String field)
        {
            System.Text.StringBuilder buffer = new System.Text.StringBuilder();
            buffer.Append("spanOr([");
            System.Collections.IEnumerator i = clauses.GetEnumerator();
            int j = 0;

            while (i.MoveNext())
            {
                j++;
                SpanQuery clause = (SpanQuery)i.Current;
                buffer.Append(clause.ToString(field));
                if (j < clauses.Count)
                {
                    buffer.Append(", ");
                }
            }
            buffer.Append("])");
            buffer.Append(ToStringUtils.Boost(GetBoost()));
            return(buffer.ToString());
        }
Пример #12
0
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder();
     buffer.Append("payloadNear([");
     System.Collections.IEnumerator i = clauses.GetEnumerator();
     while (i.MoveNext())
     {
         SpanQuery clause = (SpanQuery)i.Current;
         buffer.Append(clause.ToString(field));
         if (i.MoveNext())
         {
             buffer.Append(", ");
         }
     }
     buffer.Append("], ");
     buffer.Append(slop);
     buffer.Append(", ");
     buffer.Append(inOrder);
     buffer.Append(")");
     buffer.Append(ToStringUtils.Boost(GetBoost()));
     return(buffer.ToString());
 }
Пример #13
0
 //@Override
 public override System.String ToString(System.String field)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     if (!this.field.Equals(field))
     {
         sb.Append(this.field).Append(':');
     }
     return(sb.Append(minInclusive?'[':'{').Append((min == null)?"*":min.ToString()).Append(" TO ").Append((max == null)?"*":max.ToString()).Append(maxInclusive?']':'}').Append(ToStringUtils.Boost(GetBoost())).ToString());
 }
Пример #14
0
        /// <summary>Prints a user-readable version of this query. </summary>
        public override System.String ToString(System.String field)
        {
            System.Text.StringBuilder buffer = new System.Text.StringBuilder();
            bool needParens = (GetBoost() != 1.0) || (GetMinimumNumberShouldMatch() > 0);

            if (needParens)
            {
                buffer.Append("(");
            }

            for (int i = 0; i < clauses.Count; i++)
            {
                BooleanClause c = (BooleanClause)clauses[i];
                if (c.IsProhibited())
                {
                    buffer.Append("-");
                }
                else if (c.IsRequired())
                {
                    buffer.Append("+");
                }

                Query subQuery = c.GetQuery();
                if (subQuery != null)
                {
                    if (subQuery is BooleanQuery)
                    {
                        // wrap sub-bools in parens
                        buffer.Append("(");
                        buffer.Append(subQuery.ToString(field));
                        buffer.Append(")");
                    }
                    else
                    {
                        buffer.Append(subQuery.ToString(field));
                    }
                }
                else
                {
                    buffer.Append("null");
                }

                if (i != clauses.Count - 1)
                {
                    buffer.Append(" ");
                }
            }

            if (needParens)
            {
                buffer.Append(")");
            }

            if (GetMinimumNumberShouldMatch() > 0)
            {
                buffer.Append('~');
                buffer.Append(GetMinimumNumberShouldMatch());
            }

            if (GetBoost() != 1.0f)
            {
                buffer.Append(ToStringUtils.Boost(GetBoost()));
            }

            return(buffer.ToString());
        }
Пример #15
0
 public override System.String ToString(System.String field)
 {
     return(valSrc.ToString() + ToStringUtils.Boost(GetBoost()));
 }