Scid  4.6.5
Functions
searchindex.cpp File Reference
#include "common.h"
#include "misc.h"
#include "scidbase.h"
#include <algorithm>
#include <string>
#include <vector>
Include dependency graph for searchindex.cpp:

Go to the source code of this file.

Functions

errorT search_index (const scidBaseT *base, HFilter &filter, int argc, const char **argv, const Progress &progress)
 search_index() - search for games using game's IndexEntry info : the scidBaseT to search : the filter to be modified with the result of the search (RESET, AND, OR operations can be applied to the filter) : number of argv elements : an array of string pairs <criteria,value> : report search progress to UI More...
 

Function Documentation

errorT search_index ( const scidBaseT base,
HFilter filter,
int  argc,
const char **  argv,
const Progress progress 
)

search_index() - search for games using game's IndexEntry info : the scidBaseT to search : the filter to be modified with the result of the search (RESET, AND, OR operations can be applied to the filter) : number of argv elements : an array of string pairs <criteria,value> : report search progress to UI

This function perform a fast games search using the IndexEntry info. Criteria should start with the char '-' and can include the optional trailing chars '!': meaning that we want the games that do not match the <criteria,value> pair '|': that allows to search for games that match at least one <criteria,value> in a group of <criteria,value> pairs

Names searches (-player, -white, -black, -event, -site -round) have special rules:

  • normal searches ignore case and spaces, so -player carlsen is equal to -player C a R L s en
  • player surname and name are usually separated by the char ,
  • exact searches (that do not ignore case and spaces) can be performed enclosing the searched value in "" like -player "Carlsen, Magnus"

Examples: -player "Carlsen, Magnus" means search for games played by (either as white or black) Carlsen (surname) Magnus (name)

-player carlsen -black kramnik means (white name contains 'carlsen' || black name contains 'carlsen') && (black name contains 'kramnik')

-white carlsen -black anand -black| kramnik -black| aronian means (white == carlsen) && (black == anand || black == kramnik || black == aronian) and will find the games played by carlsen as white against anand, or kramnik, or aronian

-elo "2700 4000" -event! blitz means elo > 2700 && elo < 4000 && event != blitz and will find the games played by players with elo greater or equal than 2700, excluding the blitz events

-welo "2700 4000" -belo|! "0 2700" -delo "-200 200" means (white elo > 2700 && white elo < 4000) || (belo is not in the range 0-2700) && ((welo - belo) > -200 && (welo - belo) < 200)

Definition at line 497 of file searchindex.cpp.