Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/main/voyager-index/src/main/java/voyager/solr/DocumentBuilderEX.java b/main/voyager-index/src/main/java/voyager/solr/DocumentBuilderEX.java
- index 10fc9d0..943faa3 100644
- --- a/main/voyager-index/src/main/java/voyager/solr/DocumentBuilderEX.java
- +++ b/main/voyager-index/src/main/java/voyager/solr/DocumentBuilderEX.java
- @@ -20,6 +20,8 @@ package voyager.solr;
- import java.util.Arrays;
- import java.util.List;
- +import com.spatial4j.core.shape.Shape;
- +import com.spatial4j.core.shape.ShapeCollection;
- import org.apache.lucene.document.Document;
- import org.apache.lucene.document.Field;
- import org.apache.lucene.index.IndexableField;
- @@ -115,9 +117,12 @@ public class DocumentBuilderEX {
- // Make sure it has the correct number
- if( sfield!=null && !sfield.multiValued() && field.getValueCount() > 1 ) {
- - throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
- - "ERROR: "+getID(doc, schema)+"multiple values encountered for non multiValued field " +
- + // shape collection is ok
- + if (!(field.getValue() instanceof Shape)) {
- + throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
- + "ERROR: "+getID(doc, schema)+"multiple values encountered for non multiValued field " +
- sfield.getName() + ": " +field.getValue() );
- + }
- }
- float fieldBoost = field.getBoost();
- @@ -136,7 +141,9 @@ public class DocumentBuilderEX {
- // load each field value
- boolean hasField = false;
- try {
- - for( Object v : field ) {
- + Iterable<Object> fieldValues =
- + field.getValue() instanceof ShapeCollection ? Arrays.asList(field.getValue()) : field;
- + for( Object v : fieldValues ) {
- if( v == null ) {
- continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement