secret
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
val jsonBuilder = new MapJSONBuilder()
val indexerSettings = new IndexerSettings(
"cache.user_marker",
"id,map_id,map_name,marker_name,num_markers,num_likes,num_comments,lat,lon",
"",
"id",
"maps",
"marker",
jsonBuilder,
1000
)
 
val mappingFile: String = "json/map_mapping.json"
val indexFile: String = "json/map_index.json"
 
def index() {
val startTime = System.nanoTime()
 
println("Deleting Index")
IndexingUtils.deleteIndex(this.client, this.indexerSettings.indexName)
Thread.sleep(1000)
println("Creating Index")
IndexingUtils.createIndex(this.client, this.indexerSettings.indexName, this.indexFile)
Thread.sleep(2000)
println("Creating Mapping")
IndexingUtils.createMapping(this.client, this.indexerSettings.indexName, this.indexerSettings.indexType, this.mappingFile)
Thread.sleep(1000)
println("Indexing Maps")
val bulkIndexer = new BulkIndexer(this.client,this.indexerSettings)
bulkIndexer.process()
val totalTime = (System.nanoTime - startTime) / 1000000000
Thread.sleep(1000)
println("Total Indexing Time: " + totalTime + " seconds.")
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.