Evergreen, in trunk as of March 2010 and for all versions after the 1.6 series, uses an advanced, configurable query parser for bibliographic searches. This new parser is much more flexible and featureful than the old one, which hard coded the syntax for parsing queries.
How about … some fun with examples!
harry potter
harry potter after(2000)
harry potter after(2000) author:rowling
harry potter after(2000) author:rowling site(ARL-ATH)
harry potter after(2000) author:rowling site(ARL-ATH) sort(pubdate)
harry potter after(2000) author:rowling site(ARL-ATH) sort(pubdate)#descending
("harry potter" && (stone || chamber)) && (author:rowling || subject:rowling) item_form(d) subject[Magic in literature]
(That last part is a facet.)
identifier|bibcn:"^123 ABC"
or right-anchored:
bibcn:"2004$"
"C++"
keyword|mat_type[DVD] sort(author)
#available keyword|mat_type[AudioCassette] site(SW) sort(title)
keyword|mat_type[VHS # BetaMax] between(1980,1989) sort(create_date)
First, we'll start with a pseudo-grammar for the new query parser with some inline notes:
regexp := valid PCRE
word := valid UTF-8 non-whitespace characters
whitespace := string matching PCRE /\s+/s
boolean_word := 'yes' | 'no' | 'true' | 'false' | '1' | '0'
modifier_marker := '#' ### configurable, default
phrase_boundary := '"'
phrase_left_anchor := '^'
phrase_right_anchor := '$'
1_word_phrase_marker := '+'
negator := '-'
search_seperator := ':' | '='
class_field_seperator := '|'
boolean_and := '&&' ### configurable, EG default
boolean_or := '||' ### configurable, EG default
subquery_start := '(' ### configurable, default
subquery_end := ')' ### configurable, default
word_list := word { ',' word }
negated_word := negator word
required_word := 1_word_phrase_marker word ### one-word phrase shortcut
phrase := phrase_boundary { phrase_left_anchor } word { whitespace word } { phrase_right_anchor } phrase_boundary
term := word | negated_word | required_word | phrase { whitespace term }
boolean_operator := boolean_and | boolean_or
registerd_class := 'keyword' | 'title' | 'author' | 'subject' | 'series' ### configurable, default for EG
class_alias := regexp ### 'kw', 'ti', 'au', 'su', 'se' and many more, configurable, loaded from IDL class cmsa where field is null
search_class := registered_class | class_alias
registered_field := word ### configurable, loaded from IDL class cmf where search_field is true
field_alias := regexp ### configurable, loaded from IDL class cmsa where field is not null
registered_facet := word ### configurable, loaded from IDL class cmf where facet_field is true
classed_search := search_class search_seperator term
search_field_list := registered_field { class_field_seperator search_field_list }
fielded_search := search_class class_field_seperator { search_field_list } search_seperator term
field_alias_search := field_alias search_seperator term
facet_list := registered_facet { class_field_seperator facet_list }
facet_value_list := term { ' # ' term }
facet_search := search_class [ class_field_seperator { facet_list } ] '[' facet_value_list ']'
search := term | classed_search | fielded_search | field_alias_search | facet_search
registered_modifier := 'available' | 'staff' | 'descending' ### and many more, defined in QueryParser implementation driver class_alias
search_modifier := modifier_marker registered_modifier | registered_modifier '(' boolean_word ')'
registered_filter := 'site' | 'sort' | 'item_type' ### and many more, defined in QueryParser implementation driver class_alias
search_filter := registered_filter '(' word_list ')' | registered_filter ':' word_list
boolean_term := term boolean_op term
subquery := subquery_start query subquery_end
query := term | boolean_term | search | search_modifier | search_filter | subquery { [boolean_op] query }
| class | name |
|---|---|
| author | conference |
| author | corporate |
| author | other |
| author | personal |
| keyword | keyword |
| series | seriestitle |
| subject | complete |
| subject | geographic |
| subject | name |
| subject | temporal |
| subject | topic |
| title | abbreviated |
| title | alternative |
| title | proper |
| title | translated |
| title | uniform |
| identifier | isbn |
| identifier | issn |
| identifier | upc |
| identifier | ismn |
| identifier | ean |
| identifier | isrc |
| identifier | sici |
| identifier | bibcn |
| identifier | accession |
| alias | class | field |
|---|---|---|
| au | author | |
| creator | author | |
| name | author | |
| kw | keyword | |
| se | series | |
| su | subject | |
| ti | title | |
| eg.author | author | |
| eg.name | author | |
| eg.keyword | keyword | |
| eg.series | series | |
| eg.subject | subject | |
| eg.title | title | |
| bib.name | author | |
| bib.nameconference | author | conference |
| bib.namecorporate | author | corporate |
| bib.namepersonal | author | personal |
| bib.namepersonalfamily | author | personal |
| bib.namepersonalgiven | author | personal |
| dc.contributor | author | |
| dc.creator | author | |
| bib.edition | keyword | |
| bib.genre | keyword | |
| bib.subjecttitle | keyword | |
| dc.identifier | keyword | |
| dc.publisher | keyword | |
| srw.serverchoice | keyword | |
| bib.titleseries | series | seriestitle |
| bib.subjectname | subject | name |
| bib.subjectoccupation | subject | complete |
| bib.subjectplace | subject | geographic |
| dc.subject | subject | |
| bib.title | title | abbreviated |
| bib.titleabbreviated | title | abbreviated |
| bib.titlealternative | title | alternative |
| bib.titletranslated | title | translated |
| bib.titleuniform | title | uniform |
| dc.title | title | |
| id | identifier | |
| dc.identifier | identifier | |
| eg.isbn | identifier | isbn |
| eg.issn | identifier | issn |
| eg.upc | identifier | upc |
| eg.callnumber | identifier | bibcn |
| class | name |
|---|---|
| author | conference |
| author | corporate |
| author | other |
| author | personal |
| series | seriestitle |
| subject | geographic |
| subject | name |
| subject | temporal |
| subject | topic |