-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from mlibrary/callumber_fix_Jan_2024
Fix callnumber logic in java plugin
- Loading branch information
Showing
3 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,40 +3,47 @@ | |
Callnumbers (LC and Dewey) | ||
Our callnumber uses custom solr java code | ||
([email protected]:billdueber/library_identifier_solr_filters) that normalizes | ||
LC and Dewey callnumbers for more accurate searching. | ||
([email protected]:mlibrary/edu-umich-lib-solrMegapack) that (very roughly) normalizes | ||
LC and Dewey callnumbers for more useful searching and sorting. | ||
We expose two custom field types and one analysis filter: | ||
* `edu.umich.library.library_identifier.schema.CallnumberSortableFieldType` | ||
* `edu.umich.lib.solr.libraryIdentifier.callnumber.fieldType.CallnumberSortableFieldType` | ||
will store the value as given, and index a value that is suitable | ||
for exact matches (callnumber:"QA 11.2 .C3"), range queries | ||
(callnumber:[* TO "QA 11.2 .C3"]), and sorting (if single-valued). It | ||
takes an argument "passThroughInvalid" (default: false) to determine | ||
whether or not to ignore (default) or pass through normalized values that don't | ||
look like call numbers. | ||
* `edu.umich.library.library_identifier.schema.CallNumberSortKeyFieldType` | ||
* `edu.umich.lib.solr.libraryIdentifier.callnumber.fieldType.CallNumberSortKeyFieldType` | ||
is much like the above but the stored value is the same as the indexed value. | ||
* `edu.umich.library.lucene.analysis.AnyCallNumberSimpleFilterFactory` | ||
* `edu.umich.lib.solr.libraryIdentifier.callnumber.analysis.AnyCallNumberSimpleFilterFactory` | ||
does the same transformation on a single token (so, use KeywordTokenizer) | ||
as above, but in the analysis chain so it can be combined with | ||
as above, but in the analysis chain, so it can be combined with | ||
`solr.EdgeNGramFilterFactory` to get prefix ("starts-with") searches for LC/Dewey. | ||
============================================================== --> | ||
|
||
|
||
<!-- For sorting and range queries. Stored is what you send it, indexed is the sortable key --> | ||
<fieldType name="any_callnumber" class="edu.umich.library.library_identifier.schema.CallnumberSortableFieldType" | ||
docValues="false" multiValued="true" stored="true" passThroughOnError="true"/> | ||
<fieldType name="any_callnumber" | ||
class="edu.umich.lib.solr.libraryIdentifier.callnumber.fieldType.CallnumberSortableFieldType" | ||
passThroughOnError="true" | ||
docValues="false" multiValued="true" stored="true" | ||
/> | ||
|
||
<fieldType name="any_callnumber_strict" class="edu.umich.library.library_identifier.schema.CallnumberSortableFieldType" | ||
<fieldType name="any_callnumber_strict" | ||
class="edu.umich.lib.solr.libraryIdentifier.callnumber.fieldType.CallnumberSortableFieldType" | ||
docValues="false" multiValued="true" stored="true"/> | ||
|
||
<!-- As above, but the index sort key is what's exposed as the stored version, too --> | ||
<fieldType name="any_callnumber_sort_key" class="edu.umich.library.library_identifier.schema.CallNumberSortKeyFieldType" | ||
docValues="false" multiValued="true" stored="true" passThroughOnError="true"/> | ||
<fieldType name="any_callnumber_sort_key" | ||
class="edu.umich.lib.solr.libraryIdentifier.callnumber.fieldType.CallNumberSortKeyFieldType" | ||
passThroughOnError="true" | ||
docValues="false" multiValued="true" stored="true"/> | ||
|
||
<fieldType name="any_callnumber_sort_key_strict" class="edu.umich.library.library_identifier.schema.CallNumberSortKeyFieldType" | ||
<fieldType name="any_callnumber_sort_key_strict" | ||
class="edu.umich.lib.solr.libraryIdentifier.callnumber.fieldType.CallNumberSortKeyFieldType" | ||
docValues="false" multiValued="true" stored="true"/> | ||
|
||
|
||
|
@@ -45,12 +52,14 @@ | |
<analyzer type="index"> | ||
<tokenizer class="solr.KeywordTokenizerFactory"/> | ||
<filter class="solr.ICUFoldingFilterFactory"/> | ||
<filter class="edu.umich.library.lucene.analysis.AnyCallNumberSimpleFilterFactory" passThroughOnError="false"/> | ||
<filter class="edu.umich.lib.solr.libraryIdentifier.callnumber.analysis.AnyCallNumberSimpleFilterFactory" | ||
passThroughOnError="false"/> | ||
<filter class="solr.EdgeNGramFilterFactory" maxGramSize="40" minGramSize="1"/> | ||
</analyzer> | ||
<analyzer type="query"> | ||
<tokenizer class="solr.KeywordTokenizerFactory"/> | ||
<filter class="solr.ICUFoldingFilterFactory"/> | ||
<filter class="edu.umich.library.lucene.analysis.AnyCallNumberSimpleFilterFactory" passThroughOnError="true"/> | ||
<filter class="edu.umich.lib.solr.libraryIdentifier.callnumber.analysis.AnyCallNumberSimpleFilterFactory" | ||
passThroughOnError="true"/> | ||
</analyzer> | ||
</fieldType> |
Binary file not shown.