Crates.io | query-parser |
lib.rs | query-parser |
version | 0.2.0 |
source | src |
created_at | 2021-07-17 01:47:29.506401 |
updated_at | 2021-07-17 02:50:21.236029 |
description | A library to parse search queries |
homepage | https://github.com/staktrace/query-parser/blob/master/README.md |
repository | https://github.com/staktrace/query-parser |
max_upload_size | |
id | 423825 |
size | 31,488 |
A simple parser for search queries. This takes a string like from:foo -subject:'a long subject \u00270c' baz
and returns it in a structured format:
Query {
raw_query: "from:foo -subject:\'a long subject \\u00270c\' baz",
terms: [
Term { negated: false, key: Some("from"), value: Simple("foo") },
Term { negated: true, key: Some("subject"), value: Simple("a long subject ✌") },
Term { negated: false, key: None, value: Simple("baz") }
]
}
The primary entry point for this library are the following functions:
parse(&str) -> Query;
parse_with_options(&str, &ParseOptions) -> Query;
Refer to the full documentation for details.