About

The ACE plug-in performs an All Copies Everywhere lookup in Pazpar2, based on information from a Pazpar2 record.

The purpose of ACE is to find a given item in as many locations as possible - and potentially more locations than the original record has.

Protocol

The AcePlugin must be executed as part of a 'record' chain, after the Pazpar2RelayPlugin.

The request syntax is thus that of a Pazpar2 record request. See Pazpar2 protocol

The response from ACE will be a record document of the same format as a regular record from Pazpar2, just potentially extended with more locations.

There is one additional argument beyond the Pazpar2 record request parameters that can be given to ACE, named 'acefilter':

GET /service-proxy/?command=record&id=[a recid]&acefilter=[a filter]

The 'acefilter' parameter is treated as a Pazpar2 'filter' for the ACE search and can thus be used to perform ACE against a different set of targets than the main search - for instance by filtering to given categories:

GET /service-proxy/?command=record&id=[a recid]&acefilter=category~aCategory

If the filter happens to exclude the record with the given ID from the ACE result set, ACE will return the original record as found in the main search.

Working Details

Based on the author and title of the incoming record from the Pazpar2RelayPlugin or equivalent, a new search will be performed against Pazpar2 with all of the same target settings.

This should provide for a very specific result set and thus ensure that any target that has this item will in fact return it.

A record command will then be executed on this result set - using the same record ID as was used to obtain the original, incoming record.

This new record is forwarded instead of the original record.

Configuration

This plug-in is configured in service-proxy.properties or equivalent.

Registration

plugins.ace = com.indexdata.serviceproxy.plugins.AcePlugin

Usage in chain

The ACE plug-in must follow a plug-in that produces a Pazpar2 record, like the relay plug-in does.

For example:

chains.record = relay,ace,statistics

Mandatory properties

# Caches the Pazpar2 client for the plug-in's own use as well as for subsequent plug-ins.
ace.PUSH!PZ2_ACE_CLIENT = record
ace.TYPE!PZ2_ACE_CLIENT = com.indexdata.serviceproxy.plugins.ace.Pz2AceRecordSession
ace.PULL!PZ2_ACE_CLIENT = record

Property Dependencies

This plug-in requires the Relay plug-in to push a bytarget document in the 
'bytarget' chain.  

Optional properties

ace.PZ2P_CLIENT_LIFETIME_MSECS = 55000      # How long the HTTP session will hold 
                                            # on to a Pazpar2 session. 
                                            # Optional: Default 55000.
                                               
ace.TIME_BETWEEN_ACE_AND_RECORD_MSECS = 100 # Grace period between an ACE request 
                                            # and subsequent record request 
                                            # (currently not important). 
                                            # Optional: Default 0
                                               
ace.ACE_SEARCH_TIME_OUT = 3000              # How long the proxy waits for an ACE 
                                            # search to return
                                            # Optional: Default 2000 msecs
                                            
ace.RECORD_TIME_OUT = 1500                  # How long the proxy waits for a record 
                                            # request to return
                                            # Optional: Default 2000 msecs
                                            
ace.DUMP_RECORDS_TO_CONSOLE = true          # For debugging
                                            # Optional: Default false
                                            
ace.PER_TARGET_HITS_THRESHOLD = 100         # The number of hits returned by any single target before ACE kicks in
                                            # If no target return more than this number of hits, ACE will be omitted
                                            # Optional: Default 100
                                            # This setting can be overridden by the target setting aceHitsThreshold
                                            # on any individual target, and the override will then take effect when
                                            # that target is present in a given record.

ace.DUMP_BYTARGET_DOC = false               # Specifies if Pazpar2's bytarget results should be logged.
                                            # Optional, default false

ace.ACE_QUERY_PATTERN                       # Can be used to customize the ACE query. Allowed substitutions are ${title}
                                            # and ${author}. Expression ?{author[ some value]} is substitued with 'some value'
                                            # in case the 'author' is non-empty, otherwise it is entirely removed.
                                            # Optional, default 'ti="${title}"?{author[ and au="${author}"]}'