Next: , Previous: Special properties, Up: Properties and Columns


7.3 Property searches

To create sparse trees and special lists with selection based on properties, the same commands are used as for tag searches (see Tag searches), and the same logic applies. For example, here is a search string:

     +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2+With={Sarah\|Denny}

If the comparison value is a plain number, a numerical comparison is done, and the allowed operators are `<', `=', `>', `<=', `>=', and `<>'. If the comparison value is enclosed in double quotes, a string comparison is done, and the same operators are allowed. If the comparison value is enclosed in curly braces, a regexp match is performed, with `=' meaning that the regexp matches the property value, and `<>' meaning that it does not match. So the search string in the example finds entries tagged `:work:' but not `:boss:', which also have a priority value `A', a `:Coffee:' property with the value `unlimited', an `Effort' property that is numerically smaller than 2, and a `:With:' property that is matched by the regular expression `Sarah\|Denny'.

You can configure Org mode to use property inheritance during a search, but beware that this can slow down searches considerably. See Property inheritance for details.

There is also a special command for creating sparse trees based on a single property:

C-c / p
Create a sparse tree based on the value of a property. This first prompts for the name of a property, and then for a value. A sparse tree is created with all entries that define this property with the given value. If you enclose the value into curly braces, it is interpreted as a regular expression and matched against the property values.