bug_8138: added 773$t field to search results

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: update installer for biblio DOM indexing

Adds the necessary bits to enable DOM indexing for bib
records as an option during installation from source.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: update miscellaneous installer scripts

Teach a couple of the quick-install scripts about
DOM mode for bibs.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: utility to generate DOM indexing configs

misc/maintenance/make_zebra_dom_cfg_from_record_abs:
  generate a DOM filter Zebra index config from a GRS-1 config

Given a Zebra record.abs file containing a set of index definitions for
Zebra's GRS-1 filter, write an equivalent DOM filter configuration.

To generate the XSLT that is to be used by Zebra, run something like
the following on the output of this utility:

xsltproc ZEBRA_CFG_DIR/xsl/koha-indexdefs-to-zebra.xsl \
  biblio-koha-indexdefs.xml \
  > ZEBRA_CFG_DIR/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl

The above example assumes that the output of the program was named
biblio-koha-indexdefs.xsl.

This commit also introduces Koha::Indexer::Utils, a new package for
misceallenous routines that support Koha's indexing definitions.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: move koha-indexdefs-to-zebra.xsl

Since the koha-indexdefs-to-zebra.xsl  stylesheet will be used
by both bib and authority indexing, put in a central location.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: add index_data_field option to DOM indexing repertoire

Adds a new kohaidx:index_data_field index definition type which
indexes all of the subfields of a MARC data field as a single
phrase, separating the contents of each with a space.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: Zebra DOM filter index definitions for MARC21 bibs

The file biblio-zebra-indexdefs.xsl, which is the stylesheet that
is used by the Zebra DOM filter to convert an incoming MARC21 bib
to its indexed form, was generated by the following two steps:

misc/maintenance/make_zebra_dom_cfg_from_record_abs \
  --input  etc/zebradb/marc_defs/marc21/biblios/record.abs \
  --output etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml

xsltproc etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl \
  etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \
  > etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl

Records indexed using this XSLTshould behave similarly to records
indexed using the GRS-1 filter and the old record.abs definition, with
the following big exception (and improvemwent): indexed phrases now
span subfield boundaries if a specific subfield wasn't specified in the
index definition.  For example, the GRS-1 filter index definition

melm 245 Title

would allow 245 $a Cats on boxes : $b cardboard fantasies

to be searched as the phrases "cats on boxes" or "cardboard fantasies",
but a title phrase seach of "cats on boxes cardboard fantasises"
wouldn't work.  The DOM filter equivalent,

<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="245">
  <target_index>Title:w</target_index>
  <target_index>Title:p</target_index>
</index_data_field>

*does* allow phrase searches to span subfield boundaries.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: -x option of rebuild_zebra.pl now works with DOM filter

One consequence is that the -x and -a options are no longer
mutually exclusive.

Also, because of the way that the GRS-1 SGML filter works, if you're
indexing multiple documents, you can't just wrap them in a document
element, but the DOM filter *requires* it.  Consequently, two
new config settings in koha-conf.xml are added to indicate the
Zebra filter in use so that the -x option of rebuild_zebra.pl
knows whether to wrap the exported records or not:

- bib_index_mode (defaults to 'grs1' if not specified)
- auth_index_mode (defaults to 'dom')

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: use Title-cover for title phrase weighting

This is offerred as a compromise alternative to creating
a new Title-rel index to avoid having the statement of
responsiblity unduly affect field weight when using the DOM
filter and MARC21 -- the problem with creating a Title-rel index
is that it would *force* reindexing upon upgrade.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: update comment to clarify availability of DOM index mode

DOM indexing is now available for both bibs and authorities.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818: add warning about not editing record.abs when using DOM filter

This commit also updates the authority and biblio DOM indexing definition
XSL to include updated header comments.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 7818 Add UNIMARC biblio records zebra DOM def files

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
I tested two UNIMARC Koha installations using the sample UNIMARC
data from the BibLibre sandbox, comparing the results with DOM
and with GRS-1 indexing. The results are very similar, though there
are some differences. Most noticeable:
* relevance and facets seem to be more accurate with DOM enabled
* the GRS-1 configuration returns approximately 10% more results with
  random single keywords like "petit," but the DOM results contain
  the most relevant items, and any lacks in the configuration can
  easily be corrected as UNIMARC users identify fields that should be
  indexed but aren't
* authority-controlled searches match exactly
* author and topic facets do not work with the out-of-the-box GRS-1
  indexing configuration (?!?)
(adding second sign-off line below because all that probably looks like
a commit message and not a sign off)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>