From cc13edf49f6680ffa1069dc3c521246370979e89 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 9 May 2013 16:13:22 -0700 Subject: [PATCH] changelog/docs for range queries #261 --- docs/changelog.rst | 8 ++++++-- docs/reference/query.rst | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 6c393e403..371e06a5e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,11 +4,15 @@ Changelog 1.1.1 (in development) ---------------------- -* The importer output now shows the number of audio files in each album. - Thanks to jayme on GitHub. +* When using queries to match on quantitative fields, you can now use + **numeric ranges**. For example, you can get a list of albums from the '90s + by typing ``beet ls year:1990..1999`` or find high-bitrate music with + ``bitrate:128000..``. See :ref:`numericquery`. Thanks to Michael Schuerig. * The :ref:`modify-cmd` now correctly converts types when modifying non-string fields. You can now safely modify the "comp" flag and the "year" field, for example. Thanks to Lucas Duailibe. +* The importer output now shows the number of audio files in each album. + Thanks to jayme on GitHub. 1.1.0 (April 29, 203) --------------------- diff --git a/docs/reference/query.rst b/docs/reference/query.rst index 7ab44b91f..578611269 100644 --- a/docs/reference/query.rst +++ b/docs/reference/query.rst @@ -107,6 +107,28 @@ implementation`_. See Python's documentation for specifics on regex syntax. .. _Python's built-in implementation: http://docs.python.org/library/re.html +.. _numericquery: + +Numeric Range Queries +--------------------- + +For numeric fields, such as year, bitrate, and track, you can query using one- +or two-sided intervals. That is, you can find music that falls within a +*range* of values. To use ranges, write a query that has two dots (``..``) at +the beginning, middle, or end of a string of numbers. Dots in the beginning +let you specify a maximum (e.g., ``..7``); dots at the end mean a minimum +(``4..``); dots in the middle mean a range (``4..7``). + +For example, this command finds all your albums that were released in the +'90s:: + + $ beet list -a year:1990..1999 + +and this command finds MP3 files with bitrates of 128k or lower:: + + $ beet list format:MP3 bitrate:..128000 + + Path Queries ------------