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.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
|
@ -124,10 +125,15 @@ public class ContextNodeFields implements DocumentModifier{
|
||||||
String name = iter.next();
|
String name = iter.next();
|
||||||
RDFNode node = row.get( name );
|
RDFNode node = row.get( name );
|
||||||
if( node != null ){
|
if( node != null ){
|
||||||
if(addSpace) {
|
String value = (node.isLiteral()) ?
|
||||||
text.append(" ").append( node.toString() );
|
node.asLiteral().getString():
|
||||||
} else {
|
node.toString();
|
||||||
text.append(node.toString());
|
if (StringUtils.isNotBlank(value)) {
|
||||||
|
if(addSpace) {
|
||||||
|
text.append(" ").append( value );
|
||||||
|
} else {
|
||||||
|
text.append(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
log.debug(name + " is null");
|
log.debug(name + " is null");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue