4.1: Introduction to Searches
ChessDB provides ways to search a database for games by many criteria. You will see in the following sections how to search for positions, players, material and patterns.
A key concept in ChessDB is the filter. Every open database (whether it is an actual ChessDB-format database, the memory-only clipbase or a PGN file) has a filter which is the subset of all games in the database that were found by the latest search. When you open a database, the filter is initially set to contain all the games. After a search, you can do many actions on the filter games that were found such as seeing them in the game list, copying them to another database, or exporting them to a PGN file.
At any time, you can see how many games are in the filter of the current database by looking at the main window status bar. The Switcher window also shows the filter size for every database.
Clearing the filter
There are several ways you can reset the filter to include all the games in the current database: use the Search / Reset filter menu command, the Ctrl+F shortcut key, the toolbar button, or press the right-mouse button on a database in the Switcher window and select Reset filter from the pop-up menu.
All ChessDB searches act on the filter in some way. For example, if a previous search has left the filter containing 30 out of the 100 games in a database, then in your next search you can choose to ignore the current filter, or only search those 30 games (restricting the filter even more), or only search the other 70 games (adding some of them to the filter). To select the filter operation, you will see a frame in each search window that looks like the diagram shown here. The three operations are:
- AND (restrict filter): searches only the games already in the filter. This search can remove games from the filter but it can never add games to it.
- OR (Add to filter): keeps all games already in the filter, and searches the games not in the filter. This search can add more games to the filter but it can never remove any.
- IGNORE (Reset filter): ignores the current filter and just searches all games. This is the default filter operation and probably the most common one you will use.
These filter operations allow you to build complex searches, for example to find all games by a particular player that reached either rook or queen endgames.
The Statistics window and Filter graph
ChessDB also provides a Statistics window showing statistical results for all games in the current filter. You can open or close it with the Windows / Statistics window menu command or the Ctrl+I shortcut. This window shows, at a glance, how many of the filter games were recent, whether they frequently end in draws, etc. While using the Tree window (explained in the next section) or doing searches in ChessDB, you may find it useful to have the Statistics window open.
Another related tool useful for examining statistical trends is the Filter graph. Open or close it with the Tools / Filter graph menu command or the Ctrl+Shift+G shortcut. This window plots a graph showing trends by decade, recent year or Elo rating for the games in the current filter. For example, it might show that a particular opening variation is unpopular amongst strong grandmasters or growing in popularity in the last few decades. Like most statistical tools, it works best with large databases. The screenshot here shows the popularity of the Scandinavian (1.e4 d5) by decade, in a database of around one million games.
There are three main types of search in ChessDB, and each has its own window. Each is described in a separate later section of this tutorial. They are:
Board search which searches for games that reach the curent displayed position. It also has other options such as finding games that have the same material and pawn structure.
Header search which is used to find games with certain players, ratings, sites, dates, results or similar criteria.
Material/pattern search which can find games reaching particular material configurations (such as rook and pawn endgames) and board patterns (such as a white isolated d-pawn).
In addition to these, there is also the Tree window that does a special (automatic) type of search: every time the board displayed in the main window changes, it finds all the games in the current database that reached the displayed position and sets the filter to contain only those games. It is the topic of the next section.
Finally, note that you can also search a database using repertoire files which are covered much later in the Advanced topics.
If you would like to contribute to the tutorial or see anything that should be updated, corrected or improved, please contact David Kirkby. But please note David only speaks English.
Website administered by Dr. David Kirkby
This page was last modified: September 16, 2007. 11:41:41 am GMT