Class SpatialDocMaker
java.lang.Object
org.apache.lucene.benchmark.byTask.feeds.DocMaker
org.apache.lucene.benchmark.byTask.feeds.SpatialDocMaker
- All Implemented Interfaces:
Closeable,AutoCloseable
Indexes spatial data according to a configured
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".-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceConverts one shape to another.Nested classes/interfaces inherited from class org.apache.lucene.benchmark.byTask.feeds.DocMaker
DocMaker.DocState -
Field Summary
FieldsFields inherited from class org.apache.lucene.benchmark.byTask.feeds.DocMaker
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SpatialStrategygetSpatialStrategy(int roundNumber) Looks up the SpatialStrategy from the given round --Config.getRoundNumber().protected SpatialStrategymakeCompositeStrategy(Config config, Map<String, String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx) Creates aDocumentobject ready for indexing.makeDocument(int size) Same asDocMaker.makeDocument(), only this method creates a document of the given size input bysize.protected RecursivePrefixTreeStrategymakeRPTStrategy(String spatialField, Config config, Map<String, String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx) protected SerializedDVStrategymakeSerializedDVStrategy(String spatialField, Config config, Map<String, String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx) makeShapeConverter(SpatialStrategy spatialStrategy, Config config, String configKeyPrefix) Optionally converts points to circles, and optionally bbox'es result.static org.locationtech.spatial4j.shape.ShapemakeShapeFromString(SpatialStrategy strategy, String name, String shapeStr) protected SpatialStrategymakeSpatialStrategy(Config config) Builds a SpatialStrategy from configuration options.protected SpatialStrategymakeSpatialStrategy(Config config, Map<String, String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx) voidsetConfig(Config config, ContentSource source) Set the configuration parameters of this doc maker.Methods inherited from class org.apache.lucene.benchmark.byTask.feeds.DocMaker
close, getDocState, resetInputs
-
Field Details
-
SPATIAL_FIELD
- See Also:
-
-
Constructor Details
-
SpatialDocMaker
public SpatialDocMaker()
-
-
Method Details
-
getSpatialStrategy
Looks up the SpatialStrategy from the given round --Config.getRoundNumber(). It's an error if it wasn't created already for this round -- when SpatialDocMaker is initialized. -
makeSpatialStrategy
Builds a SpatialStrategy from configuration options. -
makeSpatialStrategy
protected SpatialStrategy makeSpatialStrategy(Config config, Map<String, String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx) -
makeRPTStrategy
-
makeSerializedDVStrategy
-
makeCompositeStrategy
protected SpatialStrategy makeCompositeStrategy(Config config, Map<String, String> configMap, org.locationtech.spatial4j.context.SpatialContext ctx) -
setConfig
Description copied from class:DocMakerSet the configuration parameters of this doc maker. -
makeShapeConverter
public static SpatialDocMaker.ShapeConverter makeShapeConverter(SpatialStrategy spatialStrategy, Config config, String configKeyPrefix) Optionally converts points to circles, and optionally bbox'es result. -
makeDocument
Description copied from class:DocMakerCreates aDocumentobject ready for indexing. This method uses theContentSourceto get the next document from the source, and creates aDocumentobject from the returned fields. IfreuseFieldswas set to true, it will reuseDocumentandFieldinstances.- Overrides:
makeDocumentin classDocMaker- Throws:
Exception
-
makeShapeFromString
public static org.locationtech.spatial4j.shape.Shape makeShapeFromString(SpatialStrategy strategy, String name, String shapeStr) -
makeDocument
Description copied from class:DocMakerSame asDocMaker.makeDocument(), only this method creates a document of the given size input bysize.- Overrides:
makeDocumentin classDocMaker- Throws:
Exception
-