search: add exclusive range syntax (id:5...10).
Support exclusive ranges for numeric metatags. For example, `id:5...10` is equivalent to `id:>=5 id:<10`. Useful for splitting searches into id ranges without the endpoints overlapping: id:100...200, id:200...300, id:300...400.
This commit is contained in:
@@ -1145,6 +1145,9 @@ class PostQueryBuilder
|
||||
|
||||
def parse_range(string, type = :integer)
|
||||
range = case string
|
||||
when /\A(.+?)\.\.\.(.+)/ # A...B
|
||||
lo, hi = [parse_cast($1, type), parse_cast($2, type)].sort
|
||||
[:between, (lo...hi)]
|
||||
when /\A(.+?)\.\.(.+)/
|
||||
lo, hi = [parse_cast($1, type), parse_cast($2, type)].sort
|
||||
[:between, (lo..hi)]
|
||||
|
||||
Reference in New Issue
Block a user