mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
Add null check in SolrServiceFileInfoPlugin for index-discovery
This commit is contained in:
@@ -52,21 +52,24 @@ public class SolrServiceFileInfoPlugin implements SolrServiceIndexPlugin {
|
|||||||
List<Bitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
if (bitstreams != null) {
|
if (bitstreams != null) {
|
||||||
for (Bitstream bitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
document.addField(SOLR_FIELD_NAME_FOR_FILENAMES, bitstream.getName());
|
if (bitstream != null)
|
||||||
// Add _keyword and _filter fields which are necessary to support filtering and faceting
|
{
|
||||||
// for the file names
|
document.addField(SOLR_FIELD_NAME_FOR_FILENAMES, bitstream.getName());
|
||||||
document.addField(SOLR_FIELD_NAME_FOR_FILENAMES + "_keyword", bitstream.getName());
|
// Add _keyword and _filter fields which are necessary to support filtering and faceting
|
||||||
document.addField(SOLR_FIELD_NAME_FOR_FILENAMES + "_filter", bitstream.getName());
|
// for the file names
|
||||||
|
document.addField(SOLR_FIELD_NAME_FOR_FILENAMES + "_keyword", bitstream.getName());
|
||||||
|
document.addField(SOLR_FIELD_NAME_FOR_FILENAMES + "_filter", bitstream.getName());
|
||||||
|
|
||||||
String description = bitstream.getDescription();
|
String description = bitstream.getDescription();
|
||||||
if ((description != null) && !description.isEmpty()) {
|
if ((description != null) && !description.isEmpty()) {
|
||||||
document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS, description);
|
document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS, description);
|
||||||
// Add _keyword and _filter fields which are necessary to support filtering and
|
// Add _keyword and _filter fields which are necessary to support filtering and
|
||||||
// faceting for the descriptions
|
// faceting for the descriptions
|
||||||
document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS + "_keyword",
|
document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS + "_keyword",
|
||||||
description);
|
description);
|
||||||
document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS + "_filter",
|
document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS + "_filter",
|
||||||
description);
|
description);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user