~ntietz/isabella-db

0948e45d0d9978db3dc63e290a73638c3ba4398d — Nicholas Tietz-Sokolsky 1 year, 2 months ago eaae02d query-design
Start on an example from a pairing session
1 files changed, 37 insertions(+), 0 deletions(-)

M docs/0003-query-design.md
M docs/0003-query-design.md => docs/0003-query-design.md +37 -0
@@ 60,3 60,40 @@ I think in general searching will be used for one of a few reasons:
I think in general, the key is to focus on *game* search, which may also entail
finding positions which the game contains which match certain criteria.



# Examples


```
(games
    (and
        (or
            (fen "rnbqkbnr/pppp1ppp/8/4p3/4PP2/8/PPPP2PP/RNBQKBNR b KQkq - 0 2")
            (fen "...")
            (fen "...")
        )
        (or
            (player black.name is "Magnus Carlsen")
            (player white.name is "Magnus Carlsen")
        )
        (player _.name contains "Nepo")
        (date before 2021-10-10)
        (move-length < 40)
        (or
            (and
                (player black.rating < white.rating)
                (player result is blackwin))
            (and
                (player white.rating < black.rating)
                (player result is whitewin))
        )
        (moves-between (<,>,=) n
            (fen "fen=rnbqkbnr/pppp1ppp/8/4p3/4PP2/8/PPPP2PP/RNBQKBNR b KQkq - 0 2")
            (fen "...")
        )
    )
)


```