Debugging queries

For debugging queries, i.e. knowing which parts of the query matched (evaluated to true) versus which parts didn’t match, you can use the script scripts/01_visualize_query_evaluation.py, as follows:

python scripts/01_visualize_query_evaluation.py --query "hello AND (world OR title)" --content "hello content" --title "a title" --print-tree --show-graph

You will get (because of --show-graph argument) the following graph on your browser:

Evaluation tree

Warning

For very long queries, the graph might be unreadable. Prefer the --print-tree option alone.

You will also get (because of --print-tree argument) the following graph on your terminal:

Evaluation tree

Note

Content (i.e. the argument --content) can be a path to a long file containing the content