ts-test
The ts-test utility can tell you how PostgreSQL would parse a log and whether a given text search query matches that log.
Usage:
<rawDocument> [<tsQuery_inclStopwords>]
or
<path to file with rawDocument> [<tsQuery_inclStopwords>]
Example Output
If you invoke ts-test with a sample rawlog as the 1 arg, ts-test outputs a list of extracted terms and a detailed term extraction report table.
In this example output, the top two rows indicate the following:
-
Token "The" was rejected by the human_language_rejecter.
-
Token " " was rejected because our config rejects the entire "Space symbols" category.
Tip: Use the --detail-spaces option to show this information in the ts-test report.
-
Token "LCE" was rejected by whole_word_rejecter.
If you provide a query string (for example, 'Authorization'), ts-test indicates whether that query string matches the sample rawlog:
To see an example of match failure, provide a nonsense query string (for example, 'Bunnies?' ).