Searching
Quickstart
You can a number of search terms, which are substring-matched against
the irclog messages (the nick of the person issuing the message is not
included in the search). All terms (delimited by whitespace) are
linked with logical and, so the search foo bar
will find all
messages that contain both foo
and bar
. You can use "advanced"
features using parentheses, like (rx "foo|bar")
, which will search
for the regular expression foo|bar
.
Details
A search always has a "base date", and a number of days it reaches backwards; both have default values:
-
The "base date" defaults to the current date, if no
date
query option is given in the URL, which is the case when you initially enter a channel activity overview page. If you use the navigation links or the "pin" links presented for each day to navigate to another day, that changes the base date to the corresponding day. -
The number of days searched by default is 14, this option can be changed in the configuration file.
The phrase (interpreted as character string) entered into the search field is parsed into a list of "search parameters" according to the following rules:
-
As long as possible, an item is consumed from the string by using the Scheme procedure for reading a datum (R5RS read, R6RS get-datum). If parsing fails at some point, the entire remainder of the string is consumed a single item. This step results in a list of Scheme datums. For example:
foo bar "hello world" 42
yields the list
(foo bar "hello world" 42)
While
(date "2008-10-26") (days 42) foo) 123
yields
((date "2008-10-26") (days 42) foo ") 123")
Note that the characters starting from the mismatched closing paren are accumulated into a single string, as the Scheme parser will fail a that point.
-
The list resulting from the previous step is broken into two parts: "search parameters" and "search expressions". A search parameter is always a list, with the first item indicating the parameter name. The following search paramaters are available:
date
— Specifies the date that the search will start at. This parameter must be written as(date "YYYY-mm-dd")
, i.e. the date must be written as a string in the ISO date notation. As noted above, the date defaults to the first day displayed on the channel overview page.days
— Specifies the number of days the search should cover. Note that the number of days is specifying how far to search back, so given a base date of 2008-12-05, and 3 days to search, the search starts at 2008-12-05, 24:00 hours and covers the time back to 2008-12-03, 0:00 hours.
A list of search expressions and how they are used for matching follows:
- strings — A string indicates a substring match, i.e. there is a match if the message contains the string given at any position.
- symbols — For convinience, symbols are converted to strings, and the resulting string is used as above, as a substring match.
(rx <expr>)
— A regular expresssion match;<expr>
must be either an extended POSIX regular expression string or a symbolic regular expression (SRE). For the exact syntax that can be used, see the irregex manual.
All search expressions specified must match for a specific log entry for it to be considered a search hit; in other words: The search expressions are combined using logical and.
There is currently no way to specify a logical or relationship, or nesting of search expressions, but this is a planned feature.