Print

Print


Need help searching a LISTSERV archive?

The Search-and-Ye-Shall-Find Tutorial
1997, 1998 Jared Weinberger
Last update: Sept. 9, 1998


You don't need a PhD in computer science to use the database; au contraire, it's a pity not to take advantage of it. The new software is easier than ever to use, too! Here are some sample searches of the Opera-L archive. Find one that suits your need and copy & paste it into your mail program. Then edit it for your specific search, send and voila! You can use your prowess to search any archive on any LISTSERV: just substitute your listname for Opera-L and change the LISTSERV address, of course. 


A few basics to keep in mind
----------------------------

1. The examples below illustrate how to search an archive by e-mail using the SEARCH command and how to order posts of interest with the GETPOST command. Some lists, opera-L included, can be accessed and searched on the Web. While searching is much easier, the basic concepts and syntax are very similar. See Web-based searching for a summary.

2. Make certain your search is a message on a single line in a post with no subject header. (Actually the subject line is ignored in searches; if your mail program requires that you have one, you can type a single character like "/".) Send all searches to [log in to unmask] (or the address of the LISTSERV of interest) and never to the list itself! The same holds for your requests for back posts. Do not add your signature (or, if you have it automatically added, remove it from your search post). Posts to LISTSERV should contain valid listserv commands only and nothing extraneous.

3. Capitalization generally does not matter. In the examples below, the words of the search language are capitalized for clarity only: lowercase works just as well.

4. A more detailed document (not without its own problems) explaining the database, including the more advanced features, is available. To request it, send LISTSERV a post with no subject header and the one-line message: GET LISTDB MEMO 

5. In trial searches you do to gain familiarity, you can help keep your LISTSERV system running smoothly (especially for archives of high-volume lists) by limiting the time period so that only a small portion of the archive is searched.


How to order posts
------------------

LISTSERV will send you back the results of your search (assuming you keep reading and learn how to do one). You will see a list of the archived posts meeting your criteria, with their item # and subject lines, plus a bit of context showing the match. You request the full post(s) by sending a GETPOST command to LISTSERV, which must be a one-line message with no subject header and no signature, e.g. 

GETPOST opera-L 4362 24605 1964

Note that you have to give the list name, there are no # signs or commas in this line, and posts do not have to be in numerical order. Each non-empty search comes back to you with a GETPOST line ready to edit and send, BUT a long string of post numbers will be truncated, and you will receive only some of the posts followed by an "Unknown command" message. 
Two solutions: 
(1) break it up into separate lines, each starting with GETPOST (the posts will arrive in separate e-mail messages from LISTSERV, one per GETPOST command). 

GETPOST opera-L 1964 4362 4381 4458 12172 22496 24605 25905 27145
GETPOST opera-L 30905 32709 34739 36577 37978 41212

(2) start the first line with "// " (slash, slash, space) and end each but the last line with " ," (space comma), e.g.

// GETPOST opera-L 1964 4362 4381 4458 12172 22496 24605 25905 27145 ,
30905 32709 34739 36577 37978 41212

You can also specify ranges, e.g. GETPOST opera-L 840 859 19464-19472


Search examples (you can copy, paste and edit these) 
---------------------------------------------------

SEARCH domingo IN opera-L

This is the basic form of the search command. Changes in the capitalization of any of the words in this example will not affect the results. Note that there are no quotation marks. No dates are specified, so the entire archive is searched. Each post is searched in its entirety, including the sender, subject line and message. 


SEARCH tosca price IN opera-L
or
SEARCH tosca NEAR price IN opera-L

Searches for all posts that contain "tosca" in the post near "price". NEAR is the "default operator", thus the two examples above give identical results. For a NEAR search to consider a post to be a match, there must be five or fewer intervening words and the two words can be no more than one line distant (the order of the two words, however, is not important). Matches for this example would include cases like "priced", "caprices" and "Toscanini" -- the "keyword in context" in the search results should help you decide which posts might be of interest. Note that there are no quote marks. Since no dates are specified in this search, all posts in the archive are searched. The manual, LISTDB MEMO, incorrectly states that the default operator is AND, when it is in fact NEAR: the two examples above are identical.


SEARCH tosca AND price IN opera-L

The AND operator must be used if you want posts that have the two words anywhere in the post.


SEARCH boehm OR bohm OR bo"hm IN opera-L FROM may 96 TO july 96

Searches for all posts with any of these spellings. The OR operator is used when any of your criteria will do. If you mistakenly use AND in this search, it will probably come back with no matches, since no single post will have all the variants. (Note that you wouldn't bother searching for the real spelling, b÷hm, since the archived posts contain no accented letters and not all e-mail programs handle them correctly anyway.)

FROM...TO is always used as a pair, with two dates. Time frame includes all of May and all of July.


SEARCH 'light baritone' IN opera-L SINCE jan 97

The quote marks mean you want these words to be adjacent in the post. Note that single quote marks ensure a wide search net, catching both "Light baritone" and "light baritones". But a search without the quotes might be better here, as this example misses a post that contains "light-timbred baritones". A SINCE expression takes one date. The search will begin with 1 Jan 97 and end with the latest archived post.


SEARCH light NEAR bariton IN opera-L SINCE jan 97
or
SEARCH light bariton IN opera-L SINCE jan 97

Probably a better way of handling the previous search. The two forms are identical, since NEAR is the default operator in a search for separate words. Dropping the "e" in "baritone" caught one post that had "light" near the adjective "baritonal". In general use the root or base form of a word: ticket will find ticket, tickets, ticketing, etc. Take into account common misspellings and variants, e.g. traveling or travelling; center or centre. 


SEARCH 'opera news' IN opera-L SINCE TODAY-15

Finds all posts containing the string "opera news" in the last 15 days (the archive is searched forward, not backward, in time). The single quotes ensure that the two words are adjacent yet will find any combination of capitalization: Opera News, opera news, OPERA NEWS, etc. (N.B. There can be no spaces on either side of the minus sign.)


SEARCH 'opera news' IN opera-L UNTIL feb 96

Finds all posts containing the string "opera news" from the earliest archived post through Feb. 1996. Only the first 100 matches (of over 200 in this time frame) are returned. Search again with a FROM...TO.. expression to list those after the first 100. An UNTIL expression takes one date.


SEARCH "White" IN opera-L FROM jan 96 TO dec 96
or
SEARCH "White" IN opera-L FROM 96 TO 96

Assume you're looking for a name, White, Whiteman, Whiteside, or something similar that you can't quite remember, in all of 1996. The double quote marks means you want an exact match in capitalization. The 131 matches is more manageable than the 487 matches for the same search without quotes (only the first 100 are returned; change the time frame to see others). Note that all of 1996 is covered in these equivalent searches.


SEARCH 'ashoka''s dream' IN opera-l

If you need single quote mark(s) (i.e. apostrophes) inside single quotes, you must double the single-quote mark(s). N.B. before the 's' there are two apostrophes. BTW, SEARCH ashoka IN opera-l would really be sufficient for the search in this case. Double quotes inside double quotes must also be doubled. Single quote mark(s) inside double quotes (and vice versa) should not be doubled. Got that?


SEARCH * IN opera-L SINCE jan 97 WHERE SENDER CONTAINS rkosovsk

Finds all posts that Bob Kosovsky sent since January 1, 1997. The asterisk (*) is used to represent "everything". N.B. the SENDER is the e-mail address of the sender only and does not include the "name" portion that you usually also see in the FROM line. If you need the current e-mail address of someone, you can use the SCAN command with all or part of the name. For example, SCAN OPERA-L pete returned a list of 21 names containing the substring "pete" along with their e-mail addresses. Note: some lists cannot be scanned; this decision rests with the listowner.


SEARCH arabella IN opera-L WHERE SENDER CONTAINS jared

Searches for all of Jared's posts containing "arabella" . (I've posted from more than one address, which is why I did not use my full, current mailing address.)


SEARCH arabella IN opera-L WHERE SENDER DOES NOT CONTAIN jared

All posts containing "arabella" except for Jared's. Only the first 100 posts are listed. Search with a FROM... TO... date expression to list more.


SEARCH * IN opera-L UNTIL may 96 WHERE SUBJECT CONTAINS tosca

Finds all posts from the earliest through May 96 where the subject line contains "tosca". Note that * is needed to represent "everything". While there are some 180 posts meeting this criteria, only the first 100 are returned (use a FROM...TO expression to list the others). Note that UNTIL may 96 is the same as UNTIL 31 may 96. UNTIL or SINCE with a month name and no day always includes the whole month in the search.


SEARCH * IN opera-L WHERE SUBJECT CONTAINS (tosca OR butterfly)

Finds all posts with either word in the subject line. Note that multiple words in the CONTAINS expression must be placed inside parentheses. This CONTAINS expression is equivalent to: ...WHERE SUBJECT CONTAINS tosca OR SUBJECT CONTAINS butterfly


SEARCH manon BUT NOT 'manon lescaut' IN opera-L

BUT NOT is the same as AND NOT. It is perhaps easier to understand. There are 380 posts compared to the 653 for a search of manon alone (only the first 100 are returned). Beware, however, that there is a price to pay with this technique: you will not catch posts that mention both operas!


// SEARCH * in opera-L since march 97 WHERE SUBJECT CONTAINS tosca and ,
sender IS [log in to unmask]

Finds all posts from [log in to unmask] with tosca in the subject line from March 1, 97 to the present. The IS (you can also use "=") means that you want an exact match; CONTAINS will generally suffice (see example above). This search command may well be longer than the width setting of your e-mail program, but LISTSERV requires it be on "one line". The solution is to start long commands with // SEARCH (note the obligatory space after the double slash) and end each but the last line with a space and a comma. This ensures that all the text is interpreted as one line.


SEARCH tosca IN opera-L.100-210
SEARCH tosca IN opera-L.-20000
SEARCH tosca IN opera-L.20000-

This form of SEARCH is useful when you want to search a range of posts by their item # (which you might have, for example, from the results of a previous search). The first example searches post #100 through #210; the second searches from #1 to #20000; and the third from #20000 to the most recent post.


The best way to learn is to experiment
--------------------------------------

Even when you make a mistake, the error message that LISTSERV sends back explains where you went wrong. For more complex searches and other advanced search features, see the above-mentioned file LISTDB MEMO available from LISTSERV.


Summary of some basic search patterns
-------------------------------------

SEARCH <w> IN opera-L
SEARCH <w> IN opera-L FROM <date1> TO <date2>
SEARCH <w> IN opera-L SINCE <date>
SEARCH <w> IN opera-L UNTIL <date>
SEARCH <w> IN opera-L SINCE TODAY-<number of days>
SEARCH * IN opera-L WHERE SUBJECT CONTAINS ...
SEARCH * IN opera-L WHERE SENDER CONTAINS ...
SEARCH <w> IN opera-L WHERE SENDER DOES NOT CONTAIN ...
SEARCH * IN opera-L SINCE <date> WHERE SENDER CONTAINS ...
SEARCH * IN opera-L SINCE <date> WHERE SUBJECT CONTAINS ...
// SEARCH * IN opera-L FROM <date1> TO <date2> WHERE ,
SUBJECT CONTAINS ... AND SENDER CONTAINS ...

<w> is your search word(s). Use * for "everything"
Note that when you have both, the time expression goes before the WHERE expression.


Valid date formats
------------------

15 october 95
In the first four examples, a four-digit year can be used, e.g. 1995

october 95
If a month is used without a day, the entire month is included in the search

oct 95
Any unambiguous month abbreviation is valid: d 95 is valid, ju 95 is not

15 Oct 95
Capitalization is not important

oct
If the year is omitted, the current year is assumed

95/10/15
With slashes, a year/month/day format is obligatory; two-digit year only

95-10-15
With hyphens, a year-month-day format is obligatory; two-digit year only

7/21
With slash, a month/day format is obligatory (current year assumed)

7-21
With hyphen, a month-day format is obligatory (current year assumed)

today
The day of the search. Convenient for relative searching.

today-20
n Days back (20 in this case) from the search day; no space before or after "-"

yesterday
The day before the search. Convenient for relative searching.

yesterday-30
n Days back (30 in this case) from yesterday. 

An example of a time expression: 

FROM yesterday-30 TO yesterday-15

-----continued in part two of two-----

Enjoy the database and send me your comments about this tutorial.
Copyright 1997, 1998 Jared Weinberger
LISTSERV is a registered trademark licensed to L-Soft international, Inc.

Searching a LISTSERV list archive
The Search and Ye Shall Find Tutorial
<http://www.mindspring.com/~jaredmarkw/searchdoc.htm>