User Tools

Site Tools


documentation:technical:search_grammar

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:technical:search_grammar [2010/03/31 13:08] – class and field aliases mikerdocumentation:technical:search_grammar [2022/02/10 13:34] (current) – external edit 127.0.0.1
Line 13: Line 13:
     * And, sort those by pub date:<code>harry potter after(2000) author:rowling site(ARL-ATH) sort(pubdate)</code>     * And, sort those by pub date:<code>harry potter after(2000) author:rowling site(ARL-ATH) sort(pubdate)</code>
     * Descending (newest first):<code>harry potter after(2000) author:rowling site(ARL-ATH) sort(pubdate)#descending</code>     * Descending (newest first):<code>harry potter after(2000) author:rowling site(ARL-ATH) sort(pubdate)#descending</code>
- +  * How about some nested boolean action:<code>("harry potter" && (stone || chamber)) && (author:rowling || subject:rowling) item_form(d) subject[Magic in literature]</code> (That last part is a facet.) 
-  * How about some nested boolean action:<code>("harry potter" && (stone || chamber)) && (author:rowling || subject:rowling) item_form(d)</code>+  * Phrase searches can be left-anchored: <code>identifier|bibcn:"^123 ABC"</code> or right-anchored: <code>bibcn:"2004$"</code> 
 +  * Phrase searches can also consider punctuation literally: <code>"C++"</code> 
 +  * Speaking of facets, imagine a locally defined index definition in the keyword class called mat_type that indexes, say, 945$m, which is a local field holding bib-level "material type" strings.  Imagine further that this field is marked as a facet field, but not a search field.  You could: 
 +    * Browse all of your DVD mat_types sorted by author:<code>keyword|mat_type[DVD] sort(author)</code> 
 +    * Find all available audio cassettes in your South West branch:<code>#available keyword|mat_type[AudioCassette] site(SW) sort(title)</code> 
 +    * Get the bibs for all of your VHS and BetaMax items published during the 80s in one browse list ordered by their approximate purchase date:<code>keyword|mat_type[VHS # BetaMax] between(1980,1989) sort(create_date)</code>
  
 === Grammar === === Grammar ===
Line 27: Line 32:
 modifier_marker       := '#'   ### configurable, default modifier_marker       := '#'   ### configurable, default
 phrase_boundary       := '"' phrase_boundary       := '"'
 +phrase_left_anchor    := '^'
 +phrase_right_anchor   := '$'
 1_word_phrase_marker  := '+' 1_word_phrase_marker  := '+'
 negator               := '-' negator               := '-'
Line 39: Line 46:
 negated_word          := negator word negated_word          := negator word
 required_word         := 1_word_phrase_marker word  ### one-word phrase shortcut required_word         := 1_word_phrase_marker word  ### one-word phrase shortcut
-phrase                := phrase_boundary word { whitespace word } phrase_boundary+phrase                := phrase_boundary { phrase_left_anchor } word { whitespace word } { phrase_right_anchor } phrase_boundary
 term                  := word | negated_word | required_word | phrase { whitespace term } term                  := word | negated_word | required_word | phrase { whitespace term }
  
Line 108: Line 115:
   * **metabib** or **metarecord** -- Metarecord search, instead of direct bibliographic record search   * **metabib** or **metarecord** -- Metarecord search, instead of direct bibliographic record search
   * **staff** -- Staff search, which includes hidden records and non-transcendent records with no items or located URIs   * **staff** -- Staff search, which includes hidden records and non-transcendent records with no items or located URIs
 +  * Cover density ranking algorithm tuning parameters, as described in the [[http://www.postgresql.org/docs/9.0/interactive/textsearch-controls.html#TEXTSEARCH-RANKING|Postgres documentation]].
 +    * **CD_logDocumentLength**    => 1
 +    * **CD_documentLength**       => 2
 +    * **CD_meanHarmonic**         => 4
 +    * **CD_uniqueWords**          => 8
 +    * **CD_logUniqueWords**       => 16
 +    * **CD_selfPlusOne**          => 32
 +  * **lucky** -- Return only the first hit, à la Google's "I'm feeling lucky" button
  
 == Registered classes (from the stock config.metabib_class) == == Registered classes (from the stock config.metabib_class) ==
Line 115: Line 130:
   * **subject** -- Any standard subject field.  Also broken down into topic, temporal, geographic and name subjects by field   * **subject** -- Any standard subject field.  Also broken down into topic, temporal, geographic and name subjects by field
   * **series** -- Series title   * **series** -- Series title
 +  * **identifier** -- Accession numbers, standard numbers (ISxN, UPC, EAN, etc), local call number strings, etc
  
 == Registered search fields (from the stock config.metabib_field) == == Registered search fields (from the stock config.metabib_field) ==
Line 134: Line 150:
 |title|translated| |title|translated|
 |title|uniform| |title|uniform|
 +|identifier|isbn|
 +|identifier|issn|
 +|identifier|upc|
 +|identifier|ismn|
 +|identifier|ean|
 +|identifier|isrc|
 +|identifier|sici|
 +|identifier|bibcn|
 +|identifier|accession|
  
 == Registered class and field aliases == == Registered class and field aliases ==
Line 175: Line 200:
 |bib.titleuniform       | title         | uniform| |bib.titleuniform       | title         | uniform|
 |dc.title               | title         | | |dc.title               | title         | |
 +|id                     | identifier    | | 
 +|dc.identifier          | identifier    | | 
 +|eg.isbn                | identifier    | isbn| 
 +|eg.issn                | identifier    | issn| 
 +|eg.upc                 | identifier    | upc| 
 +|eg.callnumber          | identifier    | bibcn|
  
 == Registered facet fields (from the stock config.metabib_field) == == Registered facet fields (from the stock config.metabib_field) ==
Line 188: Line 218:
 |subject|temporal| |subject|temporal|
 |subject|topic| |subject|topic|
 +  
documentation/technical/search_grammar.1270055285.txt.gz · Last modified: 2022/02/10 13:33 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.