query-parser 0.2.0

A library to parse search queries
Documentation
  • Coverage
  • 12.5%
    2 out of 16 items documented0 out of 9 items with examples
  • Size
  • Source code size: 31.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.3 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • staktrace/query-parser
    6 2 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • staktrace

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.