public class SpatialDocMaker extends DocMaker
SpatialStrategy
with optional
shape transformation via a configured SpatialDocMaker.ShapeConverter
. The converter can turn points into
circles and bounding boxes, in order to vary the type of indexing performance tests.
Unless it's subclass-ed to do otherwise, this class configures a SpatialContext
,
SpatialPrefixTree
, and RecursivePrefixTreeStrategy
. The Strategy is made
available to a query maker via the static method getSpatialStrategy(int)
.
See spatial.alg for a listing of spatial parameters, in particular those starting with "spatial."
and "doc.spatial".Modifier and Type | Class and Description |
---|---|
static interface |
SpatialDocMaker.ShapeConverter
Converts one shape to another.
|
DocMaker.DocState
Modifier and Type | Field and Description |
---|---|
static String |
SPATIAL_FIELD |
BODY_FIELD, bodyValType, BYTES_FIELD, config, DATE_FIELD, DATE_MSEC_FIELD, ID_FIELD, indexProperties, NAME_FIELD, reuseFields, source, TIME_SEC_FIELD, TITLE_FIELD, valType
Constructor and Description |
---|
SpatialDocMaker() |
Modifier and Type | Method and Description |
---|---|
static SpatialStrategy |
getSpatialStrategy(int roundNumber)
Looks up the SpatialStrategy from the given round --
Config.getRoundNumber() . |
protected SpatialStrategy |
makeCompositeStrategy(Config config,
Map<String,String> configMap,
org.locationtech.spatial4j.context.SpatialContext ctx) |
Document |
makeDocument()
Creates a
Document object ready for indexing. |
Document |
makeDocument(int size)
Same as
DocMaker.makeDocument() , only this method creates a document of the
given size input by size . |
protected RecursivePrefixTreeStrategy |
makeRPTStrategy(String spatialField,
Config config,
Map<String,String> configMap,
org.locationtech.spatial4j.context.SpatialContext ctx) |
protected SerializedDVStrategy |
makeSerializedDVStrategy(String spatialField,
Config config,
Map<String,String> configMap,
org.locationtech.spatial4j.context.SpatialContext ctx) |
static SpatialDocMaker.ShapeConverter |
makeShapeConverter(SpatialStrategy spatialStrategy,
Config config,
String configKeyPrefix)
Optionally converts points to circles, and optionally bbox'es result.
|
static org.locationtech.spatial4j.shape.Shape |
makeShapeFromString(SpatialStrategy strategy,
String name,
String shapeStr) |
protected SpatialStrategy |
makeSpatialStrategy(Config config)
Builds a SpatialStrategy from configuration options.
|
protected SpatialStrategy |
makeSpatialStrategy(Config config,
Map<String,String> configMap,
org.locationtech.spatial4j.context.SpatialContext ctx) |
void |
setConfig(Config config,
ContentSource source)
Set the configuration parameters of this doc maker.
|
close, getDocState, resetInputs
public static final String SPATIAL_FIELD
public static SpatialStrategy getSpatialStrategy(int roundNumber)
Config.getRoundNumber()
. It's an error
if it wasn't created already for this round -- when SpatialDocMaker is initialized.protected SpatialStrategy makeSpatialStrategy(Config config)
protected SpatialStrategy makeSpatialStrategy(Config config, Map<String,String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx)
protected RecursivePrefixTreeStrategy makeRPTStrategy(String spatialField, Config config, Map<String,String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx)
protected SerializedDVStrategy makeSerializedDVStrategy(String spatialField, Config config, Map<String,String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx)
protected SpatialStrategy makeCompositeStrategy(Config config, Map<String,String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx)
public void setConfig(Config config, ContentSource source)
DocMaker
public static SpatialDocMaker.ShapeConverter makeShapeConverter(SpatialStrategy spatialStrategy, Config config, String configKeyPrefix)
public Document makeDocument() throws Exception
DocMaker
Document
object ready for indexing. This method uses the
ContentSource
to get the next document from the source, and creates
a Document
object from the returned fields. If
reuseFields
was set to true, it will reuse Document
and Field
instances.makeDocument
in class DocMaker
Exception
public static org.locationtech.spatial4j.shape.Shape makeShapeFromString(SpatialStrategy strategy, String name, String shapeStr)
public Document makeDocument(int size) throws Exception
DocMaker
DocMaker.makeDocument()
, only this method creates a document of the
given size input by size
.makeDocument
in class DocMaker
Exception
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.