List of usage examples for org.apache.solr.schema AbstractSpatialFieldType getStrategy
public T getStrategy(final String fieldName)
From source file:com.gogobot.DistanceParser.java
License:Apache License
private MultiValueSource parseSfield(FunctionQParser fp) throws SyntaxError { String sfield = fp.getParam(SpatialParams.FIELD); if (sfield == null) return null; SchemaField sf = fp.getReq().getSchema().getField(sfield); FieldType type = sf.getType();//from w ww . j ava 2 s. c o m if (type instanceof AbstractSpatialFieldType) { AbstractSpatialFieldType asft = (AbstractSpatialFieldType) type; return new SpatialStrategyMultiValueSource(asft.getStrategy(sfield)); } ValueSource vs = type.getValueSource(sf, fp); if (vs instanceof MultiValueSource) { return (MultiValueSource) vs; } throw new SyntaxError( "Spatial field must implement MultiValueSource or extend AbstractSpatialFieldType:" + sf); }