-
-
Save acampagna/a16e5946b67c6d12b2b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment