diff --git a/adlr_link/alpha/config/vufind/searchspecs.yaml b/adlr_link/alpha/config/vufind/searchspecs.yaml index 30530d574ff9c2cb95d04559fc96352a7deb5795..43e397e5816966ac5b603856e1b80985e80bf47e 100644 --- a/adlr_link/alpha/config/vufind/searchspecs.yaml +++ b/adlr_link/alpha/config/vufind/searchspecs.yaml @@ -21,66 +21,86 @@ # - field2^boost # - field3^boost # # DismaxParams is optional and allows you to override default Dismax settings -# # (i.e. mm / bf) on a search-by-search basis. If you want global default -# # values for these settings, you can edit the "dismax" search handler in +# # (i.e. mm / bf) on a search-by-search basis. Enclose the parameter values +# # in quotes for proper behavior. If you want global default values for these +# # settings, you can edit the appropriate search handler in # # solr/biblio/conf/solrconfig.xml. # DismaxParams: # - [param1_name, param1_value] # - [param2_name, param2_value] # - [param3_name, param3_value] -# # QueryFields define the fields we are searching when not using Dismax +# # This optional setting may be used to specify which Dismax handler to use. By +# # default, VuFind provides two options: dismax (for the old, standard +# # Dismax) and edismax (for Extended Dismax). You can also configure your own +# # in solrconfig.xml, but VuFind relies on the name "edismax" to identify an +# # Extended Dismax handler. If you omit this setting, the default value from +# # the default_dismax_handler setting in the [Index] section of config.ini +# # will be used. +# DismaxHandler: dismax|edismax +# # QueryFields define the fields we are searching when not using Dismax; VuFind +# # detects queries that will not work with Dismax and switches to QueryFields +# # as needed. # QueryFields: -# - SolrField: +# SolrField: # - [howToMungeSearchstring, weight] # - [differentMunge, weight] -# - DifferentSolrField: +# DifferentSolrField: # - [howToMunge, weight] # # The optional FilterQuery section allows you to AND a static query to the # # dynamic query generated using the QueryFields; see JournalTitle below -# # for an example. This is applied whether we use DismaxFields or +# # for an example. This is applied whether we use DismaxFields or # # QueryFields. # FilterQuery: (optional Lucene filter query) -# +# ExactSettings: +# DismaxFields: ... +# QueryFields: ... +# # All the same settings as above, but for exact searches, i.e. search terms +# # enclosed in quotes. Allows different fields or weights for exact +# # searches. See below for commented-out examples. +# # ...etc. # #----------------------------------------------------------------------------------- # -# Within the QueryFields area, fields are OR'd together, unless they're in an -# anonymous array, in which case the first element is a two-value array that tells -# us what the type (AND or OR) and weight of the whole group should be. +# Within the QueryFields area, fields are OR'd together, unless they're in an +# anonymous array with a numeric instead of alphanumeric key, in which case the +# first element is a two-value array that tells us what the type (AND or OR) and +# weight of the whole group should be. # # So, given: # # test: # QueryFields: -# - A: +# A: # - [onephrase, 500] # - [and, 200] -# - B: -# - [and, 100] -# - [or, 50] -# # Start an anonymous array to group; first element indicates AND grouping +# B: +# - [and, 100] +# - [or, 50] +# # Start an anonymous array to group; first element indicates AND grouping # # and a weight of 50 -# - -# - [AND, 50] -# - C: +# 0: +# 0: +# - AND +# - 50 +# C: # - [onephrase, 200] -# - D: +# D: # - [onephrase, 300] -# # Note the "not" attached to the field name as a minus, and the use of ~ +# # Note the "not" attached to the field name as a minus, and the use of ~ # # to mean null ("no special weight") -# - -E: +# -E: # - [or, ~] -# - D: +# D: # - [or, 100] -# -# ...and the search string +# +# ...and the search string # # test "one two" # # ...we'd get -# -# (A:"test one two"^500 OR +# +# (A:"test one two"^500 OR # A:(test AND "one two")^ 200 OR # B:(test AND "one two")^100 OR # B:(test OR "one two")^50 @@ -108,6 +128,10 @@ # testing "one two" # ...becomes (testing OR "one two") # +# identity: Use the search as-is +# testing "one two" +# ...becomes (testing "one two") +# # Additional Munge types can be defined in the CustomMunge section. Each array # entry under CustomMunge defines a new named munge type. Each array entry under # the name of the munge type specifies a string manipulation operation. Operations @@ -119,7 +143,8 @@ # [append, text] - Append text to the end of the user's search string # [lowercase] - Convert string to lowercase # [preg_replace, pattern, replacement] - Perform a regular expression replace -# using the preg_replace() PHP function +# using the preg_replace() PHP function. If you use backreferences in your +# replacement phrase, be sure to escape dollar signs (i.e. \$1, not $1). # [uppercase] - Convert string to uppercase # # See the CallNumber search below for an example of custom munging in action. @@ -130,11 +155,12 @@ Author: DismaxParams: - [bf , ord(publishDateSort)^10] DismaxFields: - - author^200 - - author2^200 + - author^400 + - author2^300 - author_id^100 - author_ref^150 - author_corp^200 + - author_corp2^200 - author_corp_ref^150 - author_orig^200 - author2_orig^200 @@ -157,6 +183,10 @@ Author: - [onephrase, 350] - [and, 200] - [or, 100] + - author_corp2: + - [onephrase, 350] + - [and, 200] + - [or, 100] - author_corp_ref: - [onephrase, 350] - [and, 200] @@ -202,9 +232,9 @@ Signatur: DismaxParams: - [mm, 0] DismaxFields: - - signatur + - callnumber_de15fid QueryFields: - - signatur: + - callnumber_de15fid: - [or, ~] # - [and, 100] # - [or, ~] @@ -213,9 +243,9 @@ Barcode: DismaxParams: - [mm, 0] DismaxFields: - - barcode + - barcode_de15fid QueryFields: - - barcode: + - barcode_de15fid: #- [and, 100] - [or, ~] @@ -238,12 +268,12 @@ Subject: - [and, 100] - [or, ~] - topic_ref: - - [onephrase, 300] - - [and, 100] + - [onephrase, 100] + - [and, 50] - [or, ~] - topic_id: - - [onephrase, 300] - - [and, 100] + - [onephrase, 100] + - [and, 50] - [or, ~] #- geographic: # - [onephrase, 300] @@ -256,7 +286,20 @@ Subject: #- era: # - [and, 100] # - [or, ~] +# ExactSettings: +# DismaxFields: +# - topic_unstemmed^150 +# QueryFields: +# - topic_unstemmed: +# - [onephrase, 350] +# - [and, 150] +# - [or, ~] +# This field definition is a compromise that supports both journal-level and +# article-level data. The disadvantage is that hits in article titles will +# be mixed in. If you are building a purely article-oriented index, you should +# customize this to remove all of the title_* fields and focus entirely on the +# container_title field. JournalTitle: DismaxFields: - title_short^500 @@ -292,9 +335,18 @@ JournalTitle: - [onephrase, 50] - [and , ~] FilterQuery: "format:Journal" +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^450 +# QueryFields: +# - title_full_unstemmed: +# - [onephrase, 450] +# - [and, 400] +# FilterQuery: "format:Journal OR format:Article" Title: DismaxParams: + - [mm, 3] - [bf , ord(publishDateSort)^10] DismaxFields: # - title_sub^200 @@ -338,6 +390,13 @@ Title: - series_orig: - [onephrase, 100] - [and, 50] +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^450 +# QueryFields: +# - title_full_unstemmed: +# - [onephrase, 450] +# - [and, 400] Series: DismaxFields: @@ -370,9 +429,11 @@ AllFields: DismaxParams: - [mm, 3] - [bf , ord(publishDateSort)^10] + - [bf , "if(exists(query({!v='source_id:0'})),10,1)^1000"] +# - [bf, "if(exists(query({!v='access_facet:Local*'})),10,1)^1000"] DismaxFields: - - title_short^750 - - title_full_unstemmed^600 + - title_short^1000 + - title_full_unstemmed^1000 - title_full^400 - title^500 - title_alt^200 @@ -381,24 +442,22 @@ AllFields: - series^50 - series2^30 - series_orig^50 - - author^300 - - author_id^100 + - author^500 - author_corp^300 - - author2^300 + - author2^400 - author_corp2^100 - - author_fuller^150 - author_ref^500 - author_corp_ref^500 - author_orig^300 - author2_orig^300 - author_corp_orig^300 - author_corp2_orig^100 - - topic_ref^500 + - topic_ref^10 - contents^10 - - topic_unstemmed^550 - - topic^500 - - geographic^300 - - genre^300 + - topic_unstemmed^15 + - topic^10 + - geographic^10 + - genre^10 - rvk_label - allfields_unstemmed^10 - allfields @@ -406,16 +465,16 @@ AllFields: - isbn - issn - ismn - - rsn + QueryFields: 0: 0: - OR - 50 title_short: - - [onephrase, 750] + - [onephrase, 1000] title_full_unstemmed: - - [onephrase, 600] + - [onephrase, 1000] - [and, 500] title_full: - [onephrase, 400] @@ -440,15 +499,12 @@ AllFields: author: - [onephrase, 500] - [and, 250] - author_id: - - [onephrase, 50] - - [and, 25] author_ref: - - [onephrase, 500] + - [onephrase, 250] - [and, 250] - [or, 250] author_corp_ref: - - [onephrase, 500] + - [onephrase, 250] - [and, 250] - [or, 250] author_orig: @@ -471,14 +527,14 @@ AllFields: contents: - [and, 10] topic_unstemmed: - - [onephrase, 550] - - [and, 500] + - [onephrase, 55] + - [and, 50] topic: - - [onephrase, 500] + - [onephrase, 50] topic_ref: - - [onephrase, 500] - - [and, 250] - - [or, 250] + - [onephrase, 10] + - [and, 5] + - [or, 5] topic_id: - [onephrase, 50] - [and, 25] @@ -488,12 +544,42 @@ AllFields: - [or, ~] fulltext: - [or, ~] + rvk_label: + - [onephrase, 500] + - [and, 250] + - [or, 250] isbn: - [onephrase, 500] issn: - [onephrase, 500] ismn: - [onephrase, 500] + imprint: + - [onephrase, 500] + +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^600 +# - topic_unstemmed^550 +# - allfields_unstemmed^10 +# - fulltext_unstemmed^10 +# - isbn +# - issn +# QueryFields: +# title_full_unstemmed: +# - [onephrase, 600] +# - [and, 500] +# topic_unstemmed: +# - [onephrase, 550] +# - [and, 500] +# allfields_unstemmed: +# - [or, 10] +# fulltext_unstemmed: +# - [or, 10] +# isbn: +# - [onephrase, ~] +# issn: +# - [onephrase, ~] # These are advanced searches that never use Dismax: id: @@ -538,30 +624,33 @@ LccBrowse: # We use two similar munges here -- one for exact matches, which will get # a very high boost factor, and one for left-anchored wildcard searches, # which will return a larger number of hits at a lower boost. - # CustomMunge: - # callnumber_exact: - # - [uppercase] + #CustomMunge: + #callnumber_exact: + #- [uppercase] # Strip whitespace and quotes: - # - [preg_replace, '/[ "]/', ""] + #- [preg_replace, '/[ "]/', ""] + # Escape colons (unescape first to avoid double-escapes): + #- [preg_replace, "/(\\\:)/", ':'] + #- [preg_replace, '/:/', '\:'] # Strip pre-existing trailing asterisks: - # - [preg_replace, "/\*+$/", ""] - # callnumber_fuzzy: - # - [uppercase] + #- [preg_replace, "/\*+$/", ""] + #callnumber_fuzzy: + #- [uppercase] # Strip whitespace and quotes: - # - [preg_replace, '/[ "]/', ""] - # Strip pre-existing trailing asterisks: - # - [preg_replace, "/\*+$/", ""] - # Ensure we have just one trailing asterisk. The trailing space inside - # the quotes has no effect on searching; it is a workaround for a - # Horde::YAML parsing glitch -- see VUFIND-160 in JIRA for details. - # - [append, "* "] - # QueryFields: - # - callnumber: - # - [callnumber_exact, 1000] - # - [callnumber_fuzzy, ~] - # - dewey-full: - # - [callnumber_exact, 1000] - # - [callnumber_fuzzy, ~] + #- [preg_replace, '/[ "]/', ""] + # Escape colons (unescape first to avoid double-escapes): + #- [preg_replace, "/(\\\:)/", ':'] + #- [preg_replace, '/:/', '\:'] + # Strip pre-existing trailing asterisks, then add a new one: + #- [preg_replace, "/\*+$/", ""] + #- [append, "*"] + QueryFields: + callnumber-search: + - [callnumber_exact, 1000] + - [callnumber_fuzzy, ~] + dewey-search: + - [callnumber_exact, 1000] + - [callnumber_fuzzy, ~] publisher: DismaxFields: diff --git a/adlr_link/config/vufind/config.ini b/adlr_link/config/vufind/config.ini index 03d2d081d52d1d2725f8c8c09c413f7032cf05d1..83fc9642aa9bbc304184667ee597634562e33e2b 100644 --- a/adlr_link/config/vufind/config.ini +++ b/adlr_link/config/vufind/config.ini @@ -28,17 +28,22 @@ title = "adlr.link - Literatur für Kommunikations- und Medienwissenschaftler" [Catalog] driver = NoILS -; This section addresses hierarchical records in the Solr index -[Hierarchy] -; Name of hierarchy driver to use if no value is specified in the hierarchytype -; field of the Solr index. -driver = Default -; Should we display hierarchy trees? (default = false) -showTree = true -; "Search within trees" can be disabled here if set to "false" (default = true) -search = false -; You can limit the number of search results highlighted when searching the tree; -; a limit is recommended if you have large trees, as otherwise large numbers of -; results can cause performance problems. If treeSearchLimit is -1 or not set, -; results will be unlimited. -treeSearchLimit = 100 \ No newline at end of file +; ***************** +; * BOF finc +; ***************** +; This section allows to set identifiers and other information which are specific +; for the library. +;[InstitutionInfo] +;bibid = "UBL" +sigel = "15-FID" +isil[] = "DE-15-FID" +;isil[] = "DE-15-100" +;isil[] = "DE-15-292" +;bik = "952000-4" + +[CustomIndex] +indexExtension = "de15fid" +;localMarcFieldOfLibraryNamespace = "ubl" +; ***************** +; * EOF finc +; ***************** diff --git a/adlr_link/config/vufind/searches.ini b/adlr_link/config/vufind/searches.ini index 14e8c35cc07c5b06cce3d5894adafac47570999b..3df301bea66c1c5d398bc12894e5818eee0d1849 100644 --- a/adlr_link/config/vufind/searches.ini +++ b/adlr_link/config/vufind/searches.ini @@ -22,7 +22,7 @@ relative_path = ../../../local/config/vufind/searches.ini ;#################################################################### [RawHiddenFilters] -0 = "institution:\"DE-15\" OR institution:\"DE-15-292\" OR institution:\"DE-15-100\"" +0 = "institution:\"DE-15-FID\" OR source_id:(73 OR 75 )" [IndexShards] ai = ai.ub.uni-leipzig.de/solr/biblio diff --git a/adlr_link/config/vufind/searchspecs.yaml b/adlr_link/config/vufind/searchspecs.yaml index 30530d574ff9c2cb95d04559fc96352a7deb5795..43e397e5816966ac5b603856e1b80985e80bf47e 100644 --- a/adlr_link/config/vufind/searchspecs.yaml +++ b/adlr_link/config/vufind/searchspecs.yaml @@ -21,66 +21,86 @@ # - field2^boost # - field3^boost # # DismaxParams is optional and allows you to override default Dismax settings -# # (i.e. mm / bf) on a search-by-search basis. If you want global default -# # values for these settings, you can edit the "dismax" search handler in +# # (i.e. mm / bf) on a search-by-search basis. Enclose the parameter values +# # in quotes for proper behavior. If you want global default values for these +# # settings, you can edit the appropriate search handler in # # solr/biblio/conf/solrconfig.xml. # DismaxParams: # - [param1_name, param1_value] # - [param2_name, param2_value] # - [param3_name, param3_value] -# # QueryFields define the fields we are searching when not using Dismax +# # This optional setting may be used to specify which Dismax handler to use. By +# # default, VuFind provides two options: dismax (for the old, standard +# # Dismax) and edismax (for Extended Dismax). You can also configure your own +# # in solrconfig.xml, but VuFind relies on the name "edismax" to identify an +# # Extended Dismax handler. If you omit this setting, the default value from +# # the default_dismax_handler setting in the [Index] section of config.ini +# # will be used. +# DismaxHandler: dismax|edismax +# # QueryFields define the fields we are searching when not using Dismax; VuFind +# # detects queries that will not work with Dismax and switches to QueryFields +# # as needed. # QueryFields: -# - SolrField: +# SolrField: # - [howToMungeSearchstring, weight] # - [differentMunge, weight] -# - DifferentSolrField: +# DifferentSolrField: # - [howToMunge, weight] # # The optional FilterQuery section allows you to AND a static query to the # # dynamic query generated using the QueryFields; see JournalTitle below -# # for an example. This is applied whether we use DismaxFields or +# # for an example. This is applied whether we use DismaxFields or # # QueryFields. # FilterQuery: (optional Lucene filter query) -# +# ExactSettings: +# DismaxFields: ... +# QueryFields: ... +# # All the same settings as above, but for exact searches, i.e. search terms +# # enclosed in quotes. Allows different fields or weights for exact +# # searches. See below for commented-out examples. +# # ...etc. # #----------------------------------------------------------------------------------- # -# Within the QueryFields area, fields are OR'd together, unless they're in an -# anonymous array, in which case the first element is a two-value array that tells -# us what the type (AND or OR) and weight of the whole group should be. +# Within the QueryFields area, fields are OR'd together, unless they're in an +# anonymous array with a numeric instead of alphanumeric key, in which case the +# first element is a two-value array that tells us what the type (AND or OR) and +# weight of the whole group should be. # # So, given: # # test: # QueryFields: -# - A: +# A: # - [onephrase, 500] # - [and, 200] -# - B: -# - [and, 100] -# - [or, 50] -# # Start an anonymous array to group; first element indicates AND grouping +# B: +# - [and, 100] +# - [or, 50] +# # Start an anonymous array to group; first element indicates AND grouping # # and a weight of 50 -# - -# - [AND, 50] -# - C: +# 0: +# 0: +# - AND +# - 50 +# C: # - [onephrase, 200] -# - D: +# D: # - [onephrase, 300] -# # Note the "not" attached to the field name as a minus, and the use of ~ +# # Note the "not" attached to the field name as a minus, and the use of ~ # # to mean null ("no special weight") -# - -E: +# -E: # - [or, ~] -# - D: +# D: # - [or, 100] -# -# ...and the search string +# +# ...and the search string # # test "one two" # # ...we'd get -# -# (A:"test one two"^500 OR +# +# (A:"test one two"^500 OR # A:(test AND "one two")^ 200 OR # B:(test AND "one two")^100 OR # B:(test OR "one two")^50 @@ -108,6 +128,10 @@ # testing "one two" # ...becomes (testing OR "one two") # +# identity: Use the search as-is +# testing "one two" +# ...becomes (testing "one two") +# # Additional Munge types can be defined in the CustomMunge section. Each array # entry under CustomMunge defines a new named munge type. Each array entry under # the name of the munge type specifies a string manipulation operation. Operations @@ -119,7 +143,8 @@ # [append, text] - Append text to the end of the user's search string # [lowercase] - Convert string to lowercase # [preg_replace, pattern, replacement] - Perform a regular expression replace -# using the preg_replace() PHP function +# using the preg_replace() PHP function. If you use backreferences in your +# replacement phrase, be sure to escape dollar signs (i.e. \$1, not $1). # [uppercase] - Convert string to uppercase # # See the CallNumber search below for an example of custom munging in action. @@ -130,11 +155,12 @@ Author: DismaxParams: - [bf , ord(publishDateSort)^10] DismaxFields: - - author^200 - - author2^200 + - author^400 + - author2^300 - author_id^100 - author_ref^150 - author_corp^200 + - author_corp2^200 - author_corp_ref^150 - author_orig^200 - author2_orig^200 @@ -157,6 +183,10 @@ Author: - [onephrase, 350] - [and, 200] - [or, 100] + - author_corp2: + - [onephrase, 350] + - [and, 200] + - [or, 100] - author_corp_ref: - [onephrase, 350] - [and, 200] @@ -202,9 +232,9 @@ Signatur: DismaxParams: - [mm, 0] DismaxFields: - - signatur + - callnumber_de15fid QueryFields: - - signatur: + - callnumber_de15fid: - [or, ~] # - [and, 100] # - [or, ~] @@ -213,9 +243,9 @@ Barcode: DismaxParams: - [mm, 0] DismaxFields: - - barcode + - barcode_de15fid QueryFields: - - barcode: + - barcode_de15fid: #- [and, 100] - [or, ~] @@ -238,12 +268,12 @@ Subject: - [and, 100] - [or, ~] - topic_ref: - - [onephrase, 300] - - [and, 100] + - [onephrase, 100] + - [and, 50] - [or, ~] - topic_id: - - [onephrase, 300] - - [and, 100] + - [onephrase, 100] + - [and, 50] - [or, ~] #- geographic: # - [onephrase, 300] @@ -256,7 +286,20 @@ Subject: #- era: # - [and, 100] # - [or, ~] +# ExactSettings: +# DismaxFields: +# - topic_unstemmed^150 +# QueryFields: +# - topic_unstemmed: +# - [onephrase, 350] +# - [and, 150] +# - [or, ~] +# This field definition is a compromise that supports both journal-level and +# article-level data. The disadvantage is that hits in article titles will +# be mixed in. If you are building a purely article-oriented index, you should +# customize this to remove all of the title_* fields and focus entirely on the +# container_title field. JournalTitle: DismaxFields: - title_short^500 @@ -292,9 +335,18 @@ JournalTitle: - [onephrase, 50] - [and , ~] FilterQuery: "format:Journal" +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^450 +# QueryFields: +# - title_full_unstemmed: +# - [onephrase, 450] +# - [and, 400] +# FilterQuery: "format:Journal OR format:Article" Title: DismaxParams: + - [mm, 3] - [bf , ord(publishDateSort)^10] DismaxFields: # - title_sub^200 @@ -338,6 +390,13 @@ Title: - series_orig: - [onephrase, 100] - [and, 50] +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^450 +# QueryFields: +# - title_full_unstemmed: +# - [onephrase, 450] +# - [and, 400] Series: DismaxFields: @@ -370,9 +429,11 @@ AllFields: DismaxParams: - [mm, 3] - [bf , ord(publishDateSort)^10] + - [bf , "if(exists(query({!v='source_id:0'})),10,1)^1000"] +# - [bf, "if(exists(query({!v='access_facet:Local*'})),10,1)^1000"] DismaxFields: - - title_short^750 - - title_full_unstemmed^600 + - title_short^1000 + - title_full_unstemmed^1000 - title_full^400 - title^500 - title_alt^200 @@ -381,24 +442,22 @@ AllFields: - series^50 - series2^30 - series_orig^50 - - author^300 - - author_id^100 + - author^500 - author_corp^300 - - author2^300 + - author2^400 - author_corp2^100 - - author_fuller^150 - author_ref^500 - author_corp_ref^500 - author_orig^300 - author2_orig^300 - author_corp_orig^300 - author_corp2_orig^100 - - topic_ref^500 + - topic_ref^10 - contents^10 - - topic_unstemmed^550 - - topic^500 - - geographic^300 - - genre^300 + - topic_unstemmed^15 + - topic^10 + - geographic^10 + - genre^10 - rvk_label - allfields_unstemmed^10 - allfields @@ -406,16 +465,16 @@ AllFields: - isbn - issn - ismn - - rsn + QueryFields: 0: 0: - OR - 50 title_short: - - [onephrase, 750] + - [onephrase, 1000] title_full_unstemmed: - - [onephrase, 600] + - [onephrase, 1000] - [and, 500] title_full: - [onephrase, 400] @@ -440,15 +499,12 @@ AllFields: author: - [onephrase, 500] - [and, 250] - author_id: - - [onephrase, 50] - - [and, 25] author_ref: - - [onephrase, 500] + - [onephrase, 250] - [and, 250] - [or, 250] author_corp_ref: - - [onephrase, 500] + - [onephrase, 250] - [and, 250] - [or, 250] author_orig: @@ -471,14 +527,14 @@ AllFields: contents: - [and, 10] topic_unstemmed: - - [onephrase, 550] - - [and, 500] + - [onephrase, 55] + - [and, 50] topic: - - [onephrase, 500] + - [onephrase, 50] topic_ref: - - [onephrase, 500] - - [and, 250] - - [or, 250] + - [onephrase, 10] + - [and, 5] + - [or, 5] topic_id: - [onephrase, 50] - [and, 25] @@ -488,12 +544,42 @@ AllFields: - [or, ~] fulltext: - [or, ~] + rvk_label: + - [onephrase, 500] + - [and, 250] + - [or, 250] isbn: - [onephrase, 500] issn: - [onephrase, 500] ismn: - [onephrase, 500] + imprint: + - [onephrase, 500] + +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^600 +# - topic_unstemmed^550 +# - allfields_unstemmed^10 +# - fulltext_unstemmed^10 +# - isbn +# - issn +# QueryFields: +# title_full_unstemmed: +# - [onephrase, 600] +# - [and, 500] +# topic_unstemmed: +# - [onephrase, 550] +# - [and, 500] +# allfields_unstemmed: +# - [or, 10] +# fulltext_unstemmed: +# - [or, 10] +# isbn: +# - [onephrase, ~] +# issn: +# - [onephrase, ~] # These are advanced searches that never use Dismax: id: @@ -538,30 +624,33 @@ LccBrowse: # We use two similar munges here -- one for exact matches, which will get # a very high boost factor, and one for left-anchored wildcard searches, # which will return a larger number of hits at a lower boost. - # CustomMunge: - # callnumber_exact: - # - [uppercase] + #CustomMunge: + #callnumber_exact: + #- [uppercase] # Strip whitespace and quotes: - # - [preg_replace, '/[ "]/', ""] + #- [preg_replace, '/[ "]/', ""] + # Escape colons (unescape first to avoid double-escapes): + #- [preg_replace, "/(\\\:)/", ':'] + #- [preg_replace, '/:/', '\:'] # Strip pre-existing trailing asterisks: - # - [preg_replace, "/\*+$/", ""] - # callnumber_fuzzy: - # - [uppercase] + #- [preg_replace, "/\*+$/", ""] + #callnumber_fuzzy: + #- [uppercase] # Strip whitespace and quotes: - # - [preg_replace, '/[ "]/', ""] - # Strip pre-existing trailing asterisks: - # - [preg_replace, "/\*+$/", ""] - # Ensure we have just one trailing asterisk. The trailing space inside - # the quotes has no effect on searching; it is a workaround for a - # Horde::YAML parsing glitch -- see VUFIND-160 in JIRA for details. - # - [append, "* "] - # QueryFields: - # - callnumber: - # - [callnumber_exact, 1000] - # - [callnumber_fuzzy, ~] - # - dewey-full: - # - [callnumber_exact, 1000] - # - [callnumber_fuzzy, ~] + #- [preg_replace, '/[ "]/', ""] + # Escape colons (unescape first to avoid double-escapes): + #- [preg_replace, "/(\\\:)/", ':'] + #- [preg_replace, '/:/', '\:'] + # Strip pre-existing trailing asterisks, then add a new one: + #- [preg_replace, "/\*+$/", ""] + #- [append, "*"] + QueryFields: + callnumber-search: + - [callnumber_exact, 1000] + - [callnumber_fuzzy, ~] + dewey-search: + - [callnumber_exact, 1000] + - [callnumber_fuzzy, ~] publisher: DismaxFields: diff --git a/adlr_link/dev/config/vufind/config.ini.sample b/adlr_link/dev/config/vufind/config.ini.sample index 91c8e7f6950e9ec934ec769670a9da3e9b585224..6b526b6a35ed8a977cde5fea1b7be426ca8e0bd7 100644 --- a/adlr_link/dev/config/vufind/config.ini.sample +++ b/adlr_link/dev/config/vufind/config.ini.sample @@ -14,7 +14,7 @@ relative_path = ../../../config/vufind/config.ini ; A comma-separated list of config sections from the parent which should be ; completely overwritten by the equivalent sections in this configuration; ; any sections not listed here will be merged on a section-by-section basis. -;override_full_sections = "Languages,AlphaBrowse_Types" +override_full_sections = "Http" ; ; Add DEV-specific customization after this header. diff --git a/adlr_link/dev/config/vufind/searchspecs.yaml b/adlr_link/dev/config/vufind/searchspecs.yaml.sample similarity index 70% rename from adlr_link/dev/config/vufind/searchspecs.yaml rename to adlr_link/dev/config/vufind/searchspecs.yaml.sample index 30530d574ff9c2cb95d04559fc96352a7deb5795..43e397e5816966ac5b603856e1b80985e80bf47e 100644 --- a/adlr_link/dev/config/vufind/searchspecs.yaml +++ b/adlr_link/dev/config/vufind/searchspecs.yaml.sample @@ -21,66 +21,86 @@ # - field2^boost # - field3^boost # # DismaxParams is optional and allows you to override default Dismax settings -# # (i.e. mm / bf) on a search-by-search basis. If you want global default -# # values for these settings, you can edit the "dismax" search handler in +# # (i.e. mm / bf) on a search-by-search basis. Enclose the parameter values +# # in quotes for proper behavior. If you want global default values for these +# # settings, you can edit the appropriate search handler in # # solr/biblio/conf/solrconfig.xml. # DismaxParams: # - [param1_name, param1_value] # - [param2_name, param2_value] # - [param3_name, param3_value] -# # QueryFields define the fields we are searching when not using Dismax +# # This optional setting may be used to specify which Dismax handler to use. By +# # default, VuFind provides two options: dismax (for the old, standard +# # Dismax) and edismax (for Extended Dismax). You can also configure your own +# # in solrconfig.xml, but VuFind relies on the name "edismax" to identify an +# # Extended Dismax handler. If you omit this setting, the default value from +# # the default_dismax_handler setting in the [Index] section of config.ini +# # will be used. +# DismaxHandler: dismax|edismax +# # QueryFields define the fields we are searching when not using Dismax; VuFind +# # detects queries that will not work with Dismax and switches to QueryFields +# # as needed. # QueryFields: -# - SolrField: +# SolrField: # - [howToMungeSearchstring, weight] # - [differentMunge, weight] -# - DifferentSolrField: +# DifferentSolrField: # - [howToMunge, weight] # # The optional FilterQuery section allows you to AND a static query to the # # dynamic query generated using the QueryFields; see JournalTitle below -# # for an example. This is applied whether we use DismaxFields or +# # for an example. This is applied whether we use DismaxFields or # # QueryFields. # FilterQuery: (optional Lucene filter query) -# +# ExactSettings: +# DismaxFields: ... +# QueryFields: ... +# # All the same settings as above, but for exact searches, i.e. search terms +# # enclosed in quotes. Allows different fields or weights for exact +# # searches. See below for commented-out examples. +# # ...etc. # #----------------------------------------------------------------------------------- # -# Within the QueryFields area, fields are OR'd together, unless they're in an -# anonymous array, in which case the first element is a two-value array that tells -# us what the type (AND or OR) and weight of the whole group should be. +# Within the QueryFields area, fields are OR'd together, unless they're in an +# anonymous array with a numeric instead of alphanumeric key, in which case the +# first element is a two-value array that tells us what the type (AND or OR) and +# weight of the whole group should be. # # So, given: # # test: # QueryFields: -# - A: +# A: # - [onephrase, 500] # - [and, 200] -# - B: -# - [and, 100] -# - [or, 50] -# # Start an anonymous array to group; first element indicates AND grouping +# B: +# - [and, 100] +# - [or, 50] +# # Start an anonymous array to group; first element indicates AND grouping # # and a weight of 50 -# - -# - [AND, 50] -# - C: +# 0: +# 0: +# - AND +# - 50 +# C: # - [onephrase, 200] -# - D: +# D: # - [onephrase, 300] -# # Note the "not" attached to the field name as a minus, and the use of ~ +# # Note the "not" attached to the field name as a minus, and the use of ~ # # to mean null ("no special weight") -# - -E: +# -E: # - [or, ~] -# - D: +# D: # - [or, 100] -# -# ...and the search string +# +# ...and the search string # # test "one two" # # ...we'd get -# -# (A:"test one two"^500 OR +# +# (A:"test one two"^500 OR # A:(test AND "one two")^ 200 OR # B:(test AND "one two")^100 OR # B:(test OR "one two")^50 @@ -108,6 +128,10 @@ # testing "one two" # ...becomes (testing OR "one two") # +# identity: Use the search as-is +# testing "one two" +# ...becomes (testing "one two") +# # Additional Munge types can be defined in the CustomMunge section. Each array # entry under CustomMunge defines a new named munge type. Each array entry under # the name of the munge type specifies a string manipulation operation. Operations @@ -119,7 +143,8 @@ # [append, text] - Append text to the end of the user's search string # [lowercase] - Convert string to lowercase # [preg_replace, pattern, replacement] - Perform a regular expression replace -# using the preg_replace() PHP function +# using the preg_replace() PHP function. If you use backreferences in your +# replacement phrase, be sure to escape dollar signs (i.e. \$1, not $1). # [uppercase] - Convert string to uppercase # # See the CallNumber search below for an example of custom munging in action. @@ -130,11 +155,12 @@ Author: DismaxParams: - [bf , ord(publishDateSort)^10] DismaxFields: - - author^200 - - author2^200 + - author^400 + - author2^300 - author_id^100 - author_ref^150 - author_corp^200 + - author_corp2^200 - author_corp_ref^150 - author_orig^200 - author2_orig^200 @@ -157,6 +183,10 @@ Author: - [onephrase, 350] - [and, 200] - [or, 100] + - author_corp2: + - [onephrase, 350] + - [and, 200] + - [or, 100] - author_corp_ref: - [onephrase, 350] - [and, 200] @@ -202,9 +232,9 @@ Signatur: DismaxParams: - [mm, 0] DismaxFields: - - signatur + - callnumber_de15fid QueryFields: - - signatur: + - callnumber_de15fid: - [or, ~] # - [and, 100] # - [or, ~] @@ -213,9 +243,9 @@ Barcode: DismaxParams: - [mm, 0] DismaxFields: - - barcode + - barcode_de15fid QueryFields: - - barcode: + - barcode_de15fid: #- [and, 100] - [or, ~] @@ -238,12 +268,12 @@ Subject: - [and, 100] - [or, ~] - topic_ref: - - [onephrase, 300] - - [and, 100] + - [onephrase, 100] + - [and, 50] - [or, ~] - topic_id: - - [onephrase, 300] - - [and, 100] + - [onephrase, 100] + - [and, 50] - [or, ~] #- geographic: # - [onephrase, 300] @@ -256,7 +286,20 @@ Subject: #- era: # - [and, 100] # - [or, ~] +# ExactSettings: +# DismaxFields: +# - topic_unstemmed^150 +# QueryFields: +# - topic_unstemmed: +# - [onephrase, 350] +# - [and, 150] +# - [or, ~] +# This field definition is a compromise that supports both journal-level and +# article-level data. The disadvantage is that hits in article titles will +# be mixed in. If you are building a purely article-oriented index, you should +# customize this to remove all of the title_* fields and focus entirely on the +# container_title field. JournalTitle: DismaxFields: - title_short^500 @@ -292,9 +335,18 @@ JournalTitle: - [onephrase, 50] - [and , ~] FilterQuery: "format:Journal" +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^450 +# QueryFields: +# - title_full_unstemmed: +# - [onephrase, 450] +# - [and, 400] +# FilterQuery: "format:Journal OR format:Article" Title: DismaxParams: + - [mm, 3] - [bf , ord(publishDateSort)^10] DismaxFields: # - title_sub^200 @@ -338,6 +390,13 @@ Title: - series_orig: - [onephrase, 100] - [and, 50] +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^450 +# QueryFields: +# - title_full_unstemmed: +# - [onephrase, 450] +# - [and, 400] Series: DismaxFields: @@ -370,9 +429,11 @@ AllFields: DismaxParams: - [mm, 3] - [bf , ord(publishDateSort)^10] + - [bf , "if(exists(query({!v='source_id:0'})),10,1)^1000"] +# - [bf, "if(exists(query({!v='access_facet:Local*'})),10,1)^1000"] DismaxFields: - - title_short^750 - - title_full_unstemmed^600 + - title_short^1000 + - title_full_unstemmed^1000 - title_full^400 - title^500 - title_alt^200 @@ -381,24 +442,22 @@ AllFields: - series^50 - series2^30 - series_orig^50 - - author^300 - - author_id^100 + - author^500 - author_corp^300 - - author2^300 + - author2^400 - author_corp2^100 - - author_fuller^150 - author_ref^500 - author_corp_ref^500 - author_orig^300 - author2_orig^300 - author_corp_orig^300 - author_corp2_orig^100 - - topic_ref^500 + - topic_ref^10 - contents^10 - - topic_unstemmed^550 - - topic^500 - - geographic^300 - - genre^300 + - topic_unstemmed^15 + - topic^10 + - geographic^10 + - genre^10 - rvk_label - allfields_unstemmed^10 - allfields @@ -406,16 +465,16 @@ AllFields: - isbn - issn - ismn - - rsn + QueryFields: 0: 0: - OR - 50 title_short: - - [onephrase, 750] + - [onephrase, 1000] title_full_unstemmed: - - [onephrase, 600] + - [onephrase, 1000] - [and, 500] title_full: - [onephrase, 400] @@ -440,15 +499,12 @@ AllFields: author: - [onephrase, 500] - [and, 250] - author_id: - - [onephrase, 50] - - [and, 25] author_ref: - - [onephrase, 500] + - [onephrase, 250] - [and, 250] - [or, 250] author_corp_ref: - - [onephrase, 500] + - [onephrase, 250] - [and, 250] - [or, 250] author_orig: @@ -471,14 +527,14 @@ AllFields: contents: - [and, 10] topic_unstemmed: - - [onephrase, 550] - - [and, 500] + - [onephrase, 55] + - [and, 50] topic: - - [onephrase, 500] + - [onephrase, 50] topic_ref: - - [onephrase, 500] - - [and, 250] - - [or, 250] + - [onephrase, 10] + - [and, 5] + - [or, 5] topic_id: - [onephrase, 50] - [and, 25] @@ -488,12 +544,42 @@ AllFields: - [or, ~] fulltext: - [or, ~] + rvk_label: + - [onephrase, 500] + - [and, 250] + - [or, 250] isbn: - [onephrase, 500] issn: - [onephrase, 500] ismn: - [onephrase, 500] + imprint: + - [onephrase, 500] + +# ExactSettings: +# DismaxFields: +# - title_full_unstemmed^600 +# - topic_unstemmed^550 +# - allfields_unstemmed^10 +# - fulltext_unstemmed^10 +# - isbn +# - issn +# QueryFields: +# title_full_unstemmed: +# - [onephrase, 600] +# - [and, 500] +# topic_unstemmed: +# - [onephrase, 550] +# - [and, 500] +# allfields_unstemmed: +# - [or, 10] +# fulltext_unstemmed: +# - [or, 10] +# isbn: +# - [onephrase, ~] +# issn: +# - [onephrase, ~] # These are advanced searches that never use Dismax: id: @@ -538,30 +624,33 @@ LccBrowse: # We use two similar munges here -- one for exact matches, which will get # a very high boost factor, and one for left-anchored wildcard searches, # which will return a larger number of hits at a lower boost. - # CustomMunge: - # callnumber_exact: - # - [uppercase] + #CustomMunge: + #callnumber_exact: + #- [uppercase] # Strip whitespace and quotes: - # - [preg_replace, '/[ "]/', ""] + #- [preg_replace, '/[ "]/', ""] + # Escape colons (unescape first to avoid double-escapes): + #- [preg_replace, "/(\\\:)/", ':'] + #- [preg_replace, '/:/', '\:'] # Strip pre-existing trailing asterisks: - # - [preg_replace, "/\*+$/", ""] - # callnumber_fuzzy: - # - [uppercase] + #- [preg_replace, "/\*+$/", ""] + #callnumber_fuzzy: + #- [uppercase] # Strip whitespace and quotes: - # - [preg_replace, '/[ "]/', ""] - # Strip pre-existing trailing asterisks: - # - [preg_replace, "/\*+$/", ""] - # Ensure we have just one trailing asterisk. The trailing space inside - # the quotes has no effect on searching; it is a workaround for a - # Horde::YAML parsing glitch -- see VUFIND-160 in JIRA for details. - # - [append, "* "] - # QueryFields: - # - callnumber: - # - [callnumber_exact, 1000] - # - [callnumber_fuzzy, ~] - # - dewey-full: - # - [callnumber_exact, 1000] - # - [callnumber_fuzzy, ~] + #- [preg_replace, '/[ "]/', ""] + # Escape colons (unescape first to avoid double-escapes): + #- [preg_replace, "/(\\\:)/", ':'] + #- [preg_replace, '/:/', '\:'] + # Strip pre-existing trailing asterisks, then add a new one: + #- [preg_replace, "/\*+$/", ""] + #- [append, "*"] + QueryFields: + callnumber-search: + - [callnumber_exact, 1000] + - [callnumber_fuzzy, ~] + dewey-search: + - [callnumber_exact, 1000] + - [callnumber_fuzzy, ~] publisher: DismaxFields: