updates to dynamic fields etc. for search, enable parameter to remove space for dynamic field

This commit is contained in:
hudajkhan 2013-01-17 11:53:41 -05:00
parent 28ce7ce277
commit dad9430c2f
2 changed files with 10 additions and 7 deletions

View file

@ -253,7 +253,7 @@
<!-- **************************** End Vitro Fields *************************** --> <!-- **************************** End Vitro Fields *************************** -->
<!-- **************************** Dynamic Fields *************************** --> <!-- **************************** Dynamic Fields *************************** -->
<dynamicField name="*_string" type="string" indexed="true" stored="true" /> <dynamicField name="*_string" type="string" indexed="true" stored="true" multiValued="true"/>
<!-- **************************** End Dynamic Fields *************************** --> <!-- **************************** End Dynamic Fields *************************** -->

View file

@ -95,7 +95,7 @@ public class ContextNodeFields implements DocumentModifier{
ResultSet results = RDFServiceUtils.sparqlSelectQuery(subInUriQuery, rdfService); ResultSet results = RDFServiceUtils.sparqlSelectQuery(subInUriQuery, rdfService);
while(results.hasNext()){ while(results.hasNext()){
valuesForQuery.append( valuesForQuery.append(
getTextForRow( results.nextSolution() ) ) ; getTextForRow( results.nextSolution(), true ) ) ;
} }
}catch(Throwable t){ }catch(Throwable t){
@ -114,7 +114,7 @@ public class ContextNodeFields implements DocumentModifier{
return allValues; return allValues;
} }
protected String getTextForRow( QuerySolution row){ protected String getTextForRow( QuerySolution row, boolean addSpace){
if( row == null ) if( row == null )
return ""; return "";
@ -124,7 +124,11 @@ 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) {
text.append(" ").append( node.toString() ); text.append(" ").append( node.toString() );
} else {
text.append(node.toString());
}
}else{ }else{
log.debug(name + " is null"); log.debug(name + " is null");
} }
@ -132,7 +136,6 @@ public class ContextNodeFields implements DocumentModifier{
return text.toString(); return text.toString();
} }
public void shutdown(){ public void shutdown(){
shutdown=true; shutdown=true;
} }