en:user_advanced:lucene
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | en:user_advanced:lucene [2023/03/13 01:46] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | |||
+ | ====== Indexing Using Lucene ====== | ||
+ | |||
+ | Lucene can be used as the collection indexer instead of MG/MGPP. You can select Lucene in GLI from the Search part of the Design Pane. | ||
+ | |||
+ | See the [[en: | ||
+ | |||
+ | === Editing the collection' | ||
+ | |||
+ | Many of the advanced features for Lucene searching are not yet available in GLI, but require you to edit the collection' | ||
+ | |||
+ | <tabbox Greenstone3> | ||
+ | A collection' | ||
+ | <tabbox Greenstone2> | ||
+ | A collection' | ||
+ | </ | ||
+ | |||
+ | ==== Sorting search results ==== | ||
+ | |||
+ | Lucene indexes can sort search results based on fields indexed. In 2.85 and 3.05, search result sort options were based on the indexes specified. If a collection had text, Title and Subject indexes, then the search results could be sorted by Title and Subject. Text and allfields indexes were ignored for sorting purposes. | ||
+ | |||
+ | For 3.06 and 2.86 and onwards, the list of search sort options is now specified separately to the list of indexes. For example, searching can be offered on Titles and Subjects, with sorting by Date and Author. The user is also now offered the option of ascending/ | ||
+ | |||
+ | If you are searching at section level, then you may want the sections to inherit document level metadata for sorting purposes. For example, if each document has a Date, and you want to sort search results by Date, then each section needs to be given that date in the index. The build option | ||
+ | |||
+ | The possible values for this option are | ||
+ | |never | ||
+ | |always | ||
+ | |unless_section_metadata_exists | include document metadata only if there is not already a value at the section.| | ||
+ | |||
+ | GLI has not been updated yet to offer a graphical interface for search result sorting, so you will need to edit the collection configuration file by hand (see [[# | ||
+ | |||
+ | |||
+ | <tabbox Greenstone3> | ||
+ | |||
+ | Fields to sort search results by are specified using ''< | ||
+ | |||
+ | |||
+ | The following is a sample search section, where the user can search in text, titles, subjects, organisations. Search results can be sorted by rank, date or no sorting. Sections inherit document level metadata for sorting. | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <search type=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <tabbox Greenstone2> | ||
+ | |||
+ | For greenstone 2, you add a sortfields line to collect.cfg, | ||
+ | |||
+ | < | ||
+ | levels document section | ||
+ | indexes dc.Title dc.Subject | ||
+ | sortfields dc.Date | ||
+ | sections_sort_on_document_metadata unless_section_metadata_exists # (a buildcol option) | ||
+ | </ | ||
+ | </ | ||
en/user_advanced/lucene.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1