advanced-query

command module
v0.0.0-...-3c27f14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 4 Imported by: 0

README

advanced-query

An advanced Google-like query parser based on ANTLR4. Support K-V, logical operator, and parentheses

Functions

Parse a kind of Google-like query expression.
Now it is only available in Go, and only the parsed field and value infos can be returned.
If you hava more custom needs, that visit the ast and do what you want is also ok.

Syntax

KeyWord Meaning Example
AND logical AND, binary operator field1:v1 AND field2:v2
OR logical OR, binary operator, lower precedence than AND field1:v1 OR field2:v2
NOT logic NOT, unary operator, lowest logical precedence NOT field1:v1
() parentheses, change the order of expression, the expression inner parentheses will be visited first field1:v1 AND (field2:v2 OR field3:v3)

All the keyword is case-insensitive. If some value is conflict with the keywords, use double quote to escape it, just like:

field1:"AND"

Examples

Please refer to the code in runtime/go/examples

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
runtime

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL