! GOLD Parser Builder
! Version 3.4.4
!
"Name" = "Simple search Grammer"
"Version" = "1.0"
"Author" = "Zhuotong Nan"
"Start Symbol" = <Query>
!—————–Sets
!Valid char for string keyword
{kw1} = {All Valid} – {Control Codes} – ["]
!Valid char for non-string keyword
{kw2} = {kw1} – {Whitespace} -[()]
!—————–Terminal
SimpleKw = {kw2}+
StringKw = ‘"’ {kw1}* ‘"’
!—————–Rules
<Keyword> ::= SimpleKw | StringKw
<Unit> ::= <Keyword>
| ‘(‘ <Query> ‘)’
<And> ::= <Query> <Unit>
| <Query> ‘and’ <Unit>
<Or> ::= <Query> ‘or’ <Unit>
<Query> ::= <And>
| <Or>
| <Unit>
支持 and, or查询,kw1 and kw2 可以省略为 kw1 kw2,支持括号优先级,支持""指定字串
通过CalithaLib engine连接到c#应用程序
语法并不复杂,但用于arcims的search_metadata比较别扭,如果将分析出来的keywords组织成arcims识别的search_metadata结构费了比较大的劲
中文搜索仍有问题,明天再检查,arcims是否有专门的设置没有。