Searches are performed by entering the search into the query field, or by entering the search-command with a colon in-front of it in the command-line mode.
Simple searches take the following form:
au=Smith |
That means, two letter code for the field you want to look through, then equal, then the string you want to search for. The special code 'al' will look through all entries. Here is a list of all codes:
code | Field(s) to search through |
id | CITEID |
bt | Bibtype |
au | Author |
ti | Title |
jo | Journal |
vo | Volume |
nu | Number |
pa | Pages |
mo | Month |
yr | Year |
kw | Keywords |
ab | Abstract |
no | Note |
ed | Editor |
pu | Publisher |
se | Series |
ad | Address |
en | Edition |
ch | Chapter |
hp | HowPublished |
tb | Booktitle |
or | Organization |
sc | School |
in | Institution |
ty | Type |
fi | file |
ur | URL |
sb | SourceBibFile (which of the currently open databases does the file belong to) |
an | Annote |
cr | CrossRef |
mi | Micellaneous |
al | Search through all fields |
As this list is hard to remember, it appears under the Query menu. Selecting one of the menu entries from that menu will simply insert the code to the query-entry field.
Once you have finished entering you query into the query-entry, press enter. All entries that match the query will be marked (you can move among the marked entries using shift-up/shift-down/alt-up/alt-down or the two leftmost arrow buttons on the button bar. The status bar will show the result of the query. Thus it might show:
Mod: Y Status: OK 6 matches found and selected =:) Database: /home/dirk/pd.bib |
This means that 6 matches were found in the last query. After a shot time, the status line will change to:
Mod: Y Status: OK 6 00022 of 00030 (00006 selected) Database: /home/dirk/pd.bib |
Showing that currently 6 entries are selected.
An unsuccessful search will display an appropriate message, and will not change the current selection. A successful query erases the previous marks.
The command line command for a query is the query, with a colon in front of it, thus:
:au=smith |
It is possible combine several queries into a boolean query. For this use the words 'AND' and 'OR' and use parentheses to group the query element. Thus you could enter:
(au=smith OR au=eva) AND ti=the |
To find all articles with author smith or eva for which the title contains the word 'the'.
Notice that the boolean not is currently not implemented. To use it, you have to use the flip marks command, either form the 'Edit->Flip all marks' menu, or the 'flip' command line command. See below for how such boolean searches
To do fuzzier searches, one can use regexp, in the following format:
au=/.*ach.*nn/ |
The regular expression is put between slashes. These can be combined with any of the other options, as in
au=/.ach.*nn/ AND au=eva |
Notice that all queries are case-insensitive.
You can use old query results in the query. Each query result is assigned a number. To invoke that result from the query history in a new search, enter the hash mark (#) followed by the number of the query, thus:
#2 OR au=lachmann |
You can also go back to old query results by double-clicking on them in the query window.
Not only queries can change the marks. The user can mark and unmark entries, or even flip all marks. When new entries are imported, they are marked. Thus it is sometimes useful to save the current marks for later use. To do this select 'Query->Store current marks', or use the 'mark' command from the command line interface. These marks are then assigned a number, and can be used in boolean queries as described above.
Thus, to find all papers writen by the author smith, but not by the author eva, do the following:
Open the query window, to have an overview of what is happening.
au=eva
Edit->flip all marks
Query->Store current marks, and notice in the query window what number was assigned to that mark. We'll assume it is #2.
#2 AND au=smith
That's it...
Sometimes it is useful to handle all entries that were used in a certain LaTeX file. For this one can use the .aux files generated during the latexing process. To select all entries mentioned in a certain aux file, choose the menu entry "Edit->mark according to aux file", use the command line syntax select aux filename all entries from that file are selected according to the CITEIDs. Notice that the old entries are not erased, which enables one to mark entries from multiple files. (See also interaction with LyX.)
bibtex doesn't handle well multiple entries with the same CITEID. To weed these out, you can select 'Edit->mark double CITEIDs' from the menu, or invoke the command 'mark double CITEIDs' from the command line. Entries will then be sorted by CITEID, and double CITEIDs will be marked.