public static string BuildRange(string fieldName, string @from, string @to, bool inclusiveFrom, bool inclusiveTo)
 {
     return("$field:$ii$from TO $to$if"
            .Replace("$field", QueryByFieldSerializer.EscapeSpaces(fieldName))
            .Replace("$ii", inclusiveFrom ? "[" : "{")
            .Replace("$if", inclusiveTo ? "]" : "}")
            .Replace("$from", @from)
            .Replace("$to", to));
 }
示例#2
0
        public override string Serialize(SolrQueryInList q)
        {
            if (string.IsNullOrEmpty(q.FieldName) || q.List == null || !q.List.Any())
            {
                return(null);
            }

            var array = q.List.Select(x => "(" + QueryByFieldSerializer.Quote(x) + ")").ToArray();

            return("(" + serializer.Serialize(new SolrQueryByField(QueryByFieldSerializer.EscapeSpaces(q.FieldName), string.Join(" OR ", array))
            {
                Quoted = false
            }) + ")");
        }