VIVO-374 Unpack Literals properly for the search index.
This commit is contained in:
parent
4e851d0c35
commit
ed39756a19
1 changed files with 10 additions and 4 deletions
|
@ -6,6 +6,7 @@ import java.util.Collection;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
|
@ -124,10 +125,15 @@ public class ContextNodeFields implements DocumentModifier{
|
|||
String name = iter.next();
|
||||
RDFNode node = row.get( name );
|
||||
if( node != null ){
|
||||
String value = (node.isLiteral()) ?
|
||||
node.asLiteral().getString():
|
||||
node.toString();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
if(addSpace) {
|
||||
text.append(" ").append( node.toString() );
|
||||
text.append(" ").append( value );
|
||||
} else {
|
||||
text.append(node.toString());
|
||||
text.append(value);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.debug(name + " is null");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue