Access Keys:
Skip to content (Access Key - 0)
My Area (Access Key - 2)


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 2 rates
Labels:
adaptor adaptor Delete
primo primo Delete
expert expert Delete
solr solr Delete
api api Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Combine Primo Central API Records with Solr Records

General Purpose


This is a Java function that takes the results from a Primo Central API record call and adds 
the records to an existing Solr Document List. This function can be used by developers who already 
have a custom catalog solution using Solr and who have access to the Primo Central API.

The code samples contain many references to Solr Document field names used in the sample
application. You will want to make sure you only reference the Solr Document field names that
you are using in your own application.



Interface Type


Adaptor



Product Version Compatibility


Compatible with Primo Central API.


Class files:


pcFields.java (file attached)

All of the Primo Central API jar files (see http://exlibrisgroup.org/display/PrimoOI/Implementing+your+client). Contact your Ex Libris representative if you do not already have copies of these files.

You will also need to install and configure xmlbeans (see http://xmlbeans.apache.org/sourceAndBinaries/index.html#Current+Release).



Implementation Steps:


Copy the pcFields.java file to your Web application's class files directory and compile. For example, in Apache-Tomcat this would go in the WEB-INF/classes directory. Also copy the code for the two List functions (addPrimoRecords, addPrimoFacets) and supporting functions in the attached codesource.txt file somewhere appropriate in your application.

*   *   *

In your Solr application you will have a SolrDocumentList instance, e.g.

QueryResponse qr = new QueryResponse();

SolrDocumentList sdl = new SolrDocumentList();

sdl = qr.getResults();

You will add the primo results to your existing List by updating the SolrDocumentList like this:

sdl = addPrimoRecords(sdl, primoResults);

Make sure you instantiate the pcFields class somewhere appropriate in your application:

public pcFields  pcfields = new pcFields();

You will also need to change all field name references in the pcFields.java file and the codesource.txt file (e.g. "materialtype_text" etc.) to match the field names that you use in your Solr application.

*   *   *

In your Solr application you will also have a Facet List:

List facets = qr.getLimitingFacets();

So similarly, with the facets, you will add the primo results to your existing facet List like this:

facets = addPrimoFacets(facets, megaResults, inst_group);

Contents



Related pages

content-reporter: net.customware.confluence.reporting.query.QueryException: Unable to locate the specified content: 'Documentation'

Page Attachments

File NameCommentSizeNumber of Downloads
codesource.txt12 kB111
pcFields.java2 kB133

Added by Joshua Greben on Jul 13, 2011 17:04, last edited by Joshua Greben on Sep 12, 2011 22:39

Adaptavist Theme Builder Powered by Atlassian Confluence