updates to dynamic fields etc. for search, enable parameter to remove space for dynamic field
This commit is contained in:
parent
28ce7ce277
commit
dad9430c2f
2 changed files with 10 additions and 7 deletions
|
@ -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 *************************** -->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class ContextNodeFields implements DocumentModifier{
|
||||||
* @return StringBuffer with text values to add to ALLTEXT field of solr Document.
|
* @return StringBuffer with text values to add to ALLTEXT field of solr Document.
|
||||||
*/
|
*/
|
||||||
protected StringBuffer executeQueryForValues( Individual individual, Collection<String> queries){
|
protected StringBuffer executeQueryForValues( Individual individual, Collection<String> queries){
|
||||||
/* execute all the queries on the list and concat the values to add to all text */
|
/* execute all the queries on the list and concat the values to add to all text */
|
||||||
RDFService rdfService = rdfServiceFactory.getRDFService();
|
RDFService rdfService = rdfServiceFactory.getRDFService();
|
||||||
StringBuffer allValues = new StringBuffer("");
|
StringBuffer allValues = new StringBuffer("");
|
||||||
|
|
||||||
|
@ -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 ){
|
||||||
text.append(" ").append( node.toString() );
|
if(addSpace) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue