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)); }
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 => "(" + (q.Quoted ? QueryByFieldSerializer.Quote(x) : x) + ")").ToArray(); return("(" + serializer.Serialize(new SolrQueryByField(QueryByFieldSerializer.EscapeSpaces(q.FieldName), string.Join(" OR ", array)) { Quoted = false }) + ")"); }