This file contains hidden or 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
n = NodeBuilder.nodeBuilder().build().start(); | |
c = n.client(); | |
Map<String, Object> storemapping = new HashMap<String, Object>(); | |
storemapping.put("type", "string"); | |
storemapping.put("store", "yes"); | |
storemapping.put("analyzer", "simplealphanum"); | |
Map<String, Object> properties = new HashMap<String, Object>(); | |
properties.put("store", storemapping); |
This file contains hidden or 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
BufferedReader reader = new BufferedReader(new FileReader("ESSettings")); | |
StringBuilder builder = new StringBuilder(); | |
String line; | |
while((line = reader.readLine()) != null){ | |
builder.append(line); | |
} | |
settings = ImmutableSettings.settingsBuilder().loadFromSource(builder.toString()).put(settingsMap).build(); | |
n = NodeBuilder.nodeBuilder().settings(settings).client(true).build().start(); | |
c = n.client(); | |
AnalyzeResponse rsvp = c.admin().indices().prepareAnalyze("THIS IS A123 45 t-0 133[orcun] TEST").setIndex("c").setField("store").execute().actionGet(); |
This file contains hidden or 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
settings = ImmutableSettings.settingsBuilder().loadFromSource(builder.toString()).put(settingsMap).build(); | |
Node searchNode = NodeBuilder.nodeBuilder().settings(settings).build().start(); | |
Client searchClient = searchNode.client(); | |
searchClient.admin().indices().create(new CreateIndexRequest(indexName)).actionGet(); |