LibreCat/Dancer-Plugin-Catmandu-OAI — pull request #2 by nicolasfranck (2014-04-02 14:22:35+00:00)
Title: Default search params

Changes:
- "granularity" can be set to these two options in the plugin configuration:
- YYYY-MM-DDThh:mm:ssZ
- YYYY-MM-DD

- "fix" can be set in the plugin configuration:

this "fix" fixes the input record(s)
this is a global fix that is applied before any action is taken on the record
e.g. GetRecord, ListRecords, and ListIdentifiers share this fix

This is not the same as the fix, as configured for every metadataPrefix.
First of all the global fix is applied, and later the fix for the metadataPrefix
is applied.

- "datestamp" is copied from the fixed record (see above), instead of
fixed by "_combined_utc_datestamp". Fixing the datestamp values
is up to the global fix (see: Catmandu::Fix::datetime_format). One
should make sure that the values in this field honor the configured "granularity".

- "default_search_params" can be set in the plugin configuration:

these arguments are given to the search method of the Catmandu::Bag.
Beware that these are overwritten inline by "start","limit","query" and "cql_query",
so those cannot be used.

This is handy for applying filters:

```
default_search_params:
fq:
- "(*:* AND NOT is_deleted:true)"
- "is_oai:true"
#cql is translated into a lucene query, so make sure Solr does not resort to a preconfigured query parser other than lucene
defType: "lucene"
facet: "false"
spellcheck: "false"
```

- $bag->get is changed by $bag->search in "GetRecord"

To honor the "default_search_params", the search method of the Catmandu::Bag
is used. These parameters are preset, and cannot be changed by "default_search_params":

start = 0
limit = 1
query = "_id:\"\""

Question: This plugin often uses Lucene queries, but Solr can be preconfigured to use for example "dismax". Should we hardcode "defType" to "lucene"?