/** * Build a Lucene document for a DSpace Collection. * * @param collection Collection to be indexed * @throws SQLException sql exception * @throws IOException IO exception */ private void buildDocument(Collection collection) throws SQLException, IOException { List<String> locations = getCollectionLocations(collection); // Create Lucene Document SolrInputDocument doc = buildDocument(Constants.COLLECTION, collection.getID(), collection.getHandle(), locations); // and populate it String name = collection.getMetadata("name"); if (name != null) { doc.addField("name", name); } //Do any additional indexing, depends on the plugins List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class); for (SolrServiceIndexPlugin solrServiceIndexPlugin : solrServiceIndexPlugins) { solrServiceIndexPlugin.additionalIndex(collection, doc); } writeDocument(doc); }
List<String> locations = getCollectionLocations(context, collection);