Ejemplo n.º 1
0
        public virtual string GetQueryExpression()
        {
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            System.Collections.ObjectModel.Collection <string> collection = CollectionQueryBase.RemoveDuplicates(this.Items);
            int num = 0;

            foreach (string current in collection)
            {
                num++;
                stringBuilder.Append(this.IndexFieldName + ":(");
                if (num < collection.Count)
                {
                    stringBuilder.Append(LuceneHelpers.Escape(current));
                    stringBuilder.Append(") ");
                    stringBuilder.Append(System.Enum.GetName(typeof(LuceneOperator), this.InnerOperator));
                    stringBuilder.Append(" ");
                }
                else
                {
                    stringBuilder.Append(LuceneHelpers.Escape(current));
                    stringBuilder.Append(")");
                }
            }
            return(stringBuilder.ToString());
        }
Ejemplo n.º 2
0
 public virtual string GetQueryExpression()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     stringBuilder.Append(SearchSettings.GetFieldNameForField(this.Field));
     stringBuilder.Append(":(");
     stringBuilder.Append(LuceneHelpers.EscapeParenthesis(this.Expression));
     stringBuilder.Append(")");
     return(stringBuilder.ToString());
 }
Ejemplo n.º 3
0
 public override string GetQueryExpression()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     stringBuilder.Append(SearchSettings.GetFieldNameForField(base.Field));
     stringBuilder.Append(":(");
     stringBuilder.Append(LuceneHelpers.Escape(base.Expression));
     stringBuilder.Append(")");
     return(stringBuilder.ToString());
 }
Ejemplo n.º 4
0
 public override string GetQueryExpression()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     stringBuilder.Append(SearchSettings.GetFieldNameForField(base.Field));
     stringBuilder.Append(":(");
     stringBuilder.Append(LuceneHelpers.Escape(base.Expression));
     stringBuilder.Append("~");
     stringBuilder.Append(this.SimilarityFactor.ToString(System.Globalization.CultureInfo.InvariantCulture).Replace(",", "."));
     stringBuilder.Append(")");
     return(stringBuilder.ToString());
 }
Ejemplo n.º 5
0
 protected static string GetSafeQuotedPhrase(string phrase)
 {
     if (phrase.StartsWith("\"", System.StringComparison.Ordinal))
     {
         phrase = phrase.Substring(1);
     }
     if (phrase.EndsWith("\"", System.StringComparison.Ordinal))
     {
         phrase = phrase.Substring(0, phrase.Length - 1);
     }
     return("\"" + LuceneHelpers.Escape(phrase) + "\"");
 }
Ejemplo n.º 6
0
 public string GetQueryExpression()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     stringBuilder.Append(SearchSettings.GetFieldNameForField(this.Field));
     stringBuilder.Append(":");
     stringBuilder.Append(this.Inclusive ? "[" : "{");
     stringBuilder.Append(LuceneHelpers.Escape(this.Start));
     stringBuilder.Append(" TO ");
     stringBuilder.Append(LuceneHelpers.Escape(this.End));
     stringBuilder.Append(this.Inclusive ? "]" : "}");
     return(stringBuilder.ToString());
 }