query-parser

Crates.ioquery-parser
lib.rsquery-parser
version0.2.0
sourcesrc
created_at2021-07-17 01:47:29.506401
updated_at2021-07-17 02:50:21.236029
descriptionA library to parse search queries
homepagehttps://github.com/staktrace/query-parser/blob/master/README.md
repositoryhttps://github.com/staktrace/query-parser
max_upload_size
id423825
size31,488
Kartikaya Gupta (kats) (staktrace)

documentation

README

query-parser

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.

Commit count: 25

cargo fmt