Actually I am using Java API which uses a node client (do not have http
port open). Finally I got it working but it look a bit amount of research.
Following is the code snippet:
CreateIndexRequest indexCreateRequest = new
CreateIndexRequest(indexName);
indexCreateRequest.source(mappingSource); //entire JSON scrpit
//Execute index creation command
CreateIndexResponse indexCreateResponse =
client.admin().indices().create(indexCreateRequest).actionGet();
-Amit.
On Fri, May 2, 2014 at 3:46 AM, Michael McCandless <
[email protected]> wrote:
> Hmm, I'm able to create an index and its mappings/settings with a single
> JSON request to http://localhost:9200/<indexName>.
>
> What settings are you trying to set?
>
> Mike
>
> http://blog.mikemccandless.com
>
>
> On Thu, May 1, 2014 at 5:10 PM, Amit Soni <[email protected]> wrote:
>
>> hello everyone - I have settings and mapping defined in a single JSON
>> document and I have been trying to find a way to create index using that
>> JSON document. I tried different code snippets but have not found one which
>> allows me to create settings as well as mapping using one JSON document.
>>
>> Any help on this will be great!
>>
>> -Amit.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BEUsstyy7qdNq%2BRmHzA-Rp9mYNYnOoQ8HESiGAvXwXVg%40mail.gmail.com<https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BEUsstyy7qdNq%2BRmHzA-Rp9mYNYnOoQ8HESiGAvXwXVg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/CAD7smRc-y_futLvWVuycgpxwSshJHawNWu8zrDkmZrfZ5sAnZw%40mail.gmail.com<https://groups.google.com/d/msgid/elasticsearch/CAD7smRc-y_futLvWVuycgpxwSshJHawNWu8zrDkmZrfZ5sAnZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BA9evo_zsdF9BwcxdwXfEwfR1-6YYLRwEAkWurGVorwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.