Index not recognized from java API

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT 'http://localhost:9200/test/''.
I could also see empty mapping for '''test' when I run curl -XGET
http://localhost:9200/_mapping, but the call to
'client.admin().indices().prepareExists("test").execute().actionGet().exists()'
returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

'

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some
snippets, how you are initiating your connection to the elasticsearch node?
This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana ambha.career@gmail.com wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT '
http://localhost:9200/test/''. I could also see empty mapping for
'''test' when I run curl -XGET http://localhost:9200/_mapping, but the
call to
'client.admin().indices().prepareExists("test").execute().actionGet().exists()'
returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

'

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I am getting 200 OK.

For standalone, I created a single node cluster, I have set cluster name
and node.anme in elasticsearch.yml. Looks like that is the problem, if I
restore to default (no cluster and node name set in elasticsearch.yml) I
get true for indices....exist().

My mapping is
{"type1":{"properties":{"description":{"type":"string"},"id":{"type":
"string"},"name":{"type":"string"}}}} . I see the same structure as output
for curl -XGET http://localhost:9200/_mapping

With default setting, I tried adding index (json as below) and in
console could not see any exception

"id":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","description":"sample
test","name":"test it".

But
curl -XGET
http://localhost:9200/test/type1/TEST2113-FFC4-4EE1-94A5-764D9EFD2C70 returns
{"_index":"test","_type":"asset","type1":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","exists":
false}. Thus looks like index is not getting created.

I could see in the console [Flambe] [Test] creating index, cause
[auto(index api)], shards [1]/[1], mappings []. Does this mean Java api is
not able to pick the mapping

Here is the code snippet I am using to add the index

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.store.type", "simplefs")
.put("index.store.fs.memory.enabled", "false")
.put("gateway.type", "none")
.put("path.data", "E:\elasticsearch-0.20.5\temp\data")
.put("path.work", "E:\elasticsearch-0.20.5\temp\work")
.put("path.logs", "E:\elasticsearch-0.20.5\temp\logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "1")
.put("node.local", true).build();
Client client =
NodeBuilder.nodeBuilder().settings(settings).node().client();
IndexRequestBuilder builder = client.prepareIndex();
builder.setIndex("test");
builder.setType("type1");
builder.setId("TEST2113-FFC4-4EE1-94A5-764D9EFD2C70");
builder.setSource(jsonString);
builder.setRefresh(true);
IndexResponse resp = client.index(builder.request()).get();

Please help

On Friday, March 22, 2013 12:37:47 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some
snippets, how you are initiating your connection to the elasticsearch node?
This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana <ambha....@gmail.com<javascript:>

wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT '
http://localhost:9200/test/''. I could also see empty mapping for
'''test' when I run curl -XGET http://localhost:9200/_mapping, but the
call to
'client.admin().indices().prepareExists("test").execute().actionGet().exists()'
returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

'

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Have a look here: http://www.elasticsearch.org/guide/reference/java-api/index_.html

I never used the get() notation but .execute().actionGet().

That said, if you are trying to connect to a running cluster, you have to add the cluster name in your Settings instance.
Have a look at: http://www.elasticsearch.org/guide/reference/java-api/client.html

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 22 mars 2013 à 09:37, Chetana ambha.career@gmail.com a écrit :

I am getting 200 OK.

For standalone, I created a single node cluster, I have set cluster name and node.anme in elasticsearch.yml. Looks like that is the problem, if I restore to default (no cluster and node name set in elasticsearch.yml) I get true for indices....exist().

My mapping is {"type1":{"properties":{"description":{"type":"string"},"id":{"type":
"string"},"name":{"type":"string"}}}} . I see the same structure as output for curl -XGET http://localhost:9200/_mapping

With default setting, I tried adding index (json as below) and in console could not see any exception
"id":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","description":"sample test","name":"test it".

But
curl -XGET http://localhost:9200/test/type1/TEST2113-FFC4-4EE1-94A5-764D9EFD2C70 returns {"_index":"test","_type":"asset","type1":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","exists":false}. Thus looks like index is not getting created.

I could see in the console [Flambe] [Test] creating index, cause [auto(index api)], shards [1]/[1], mappings []. Does this mean Java api is not able to pick the mapping

Here is the code snippet I am using to add the index

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.store.type", "simplefs")
.put("index.store.fs.memory.enabled", "false")
.put("gateway.type", "none")
.put("path.data", "E:\elasticsearch-0.20.5\temp\data")
.put("path.work", "E:\elasticsearch-0.20.5\temp\work")
.put("path.logs", "E:\elasticsearch-0.20.5\temp\logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "1")
.put("node.local", true).build();
Client client = NodeBuilder.nodeBuilder().settings(settings).node().client();
IndexRequestBuilder builder = client.prepareIndex();
builder.setIndex("test");
builder.setType("type1");
builder.setId("TEST2113-FFC4-4EE1-94A5-764D9EFD2C70");
builder.setSource(jsonString);
builder.setRefresh(true);
IndexResponse resp = client.index(builder.request()).get();

Please help

On Friday, March 22, 2013 12:37:47 PM UTC+5:30, Alexander Reelsen wrote:
Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some snippets, how you are initiating your connection to the elasticsearch node? This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana ambha....@gmail.com wrote:
I am new to ElasticSearch. Using Elastic search(version 0.20.5) as Standalone. I have created index using 'curl -XPUT 'http://localhost:9200/test/''. I could also see empty mapping for '''test' when I run curl -XGET http://localhost:9200/_mapping, but the call to 'client.admin().indices().prepareExists("test").execute().actionGet().exists()' returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

'

--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

looking at your java code you are actually creating your own instance,
instead of connecting to your existing elasticsearch instance. See this
line which creates an elasticsearch node:

NodeBuilder.nodeBuilder().settings(settings).node()

If the node you created is not joining as a cluster with your already
running elasticsearch instance, it will not see the created index and
therefore show your error. Take a look at your logfiles if you are seeing
any cluster joins. Also I think you need to call node.start() in order to
fire it up.

--Alex

On Fri, Mar 22, 2013 at 9:37 AM, Chetana ambha.career@gmail.com wrote:

I am getting 200 OK.

For standalone, I created a single node cluster, I have set cluster name
and node.anme in elasticsearch.yml. Looks like that is the problem, if I
restore to default (no cluster and node name set in elasticsearch.yml) I
get true for indices....exist().

My mapping is
{"type1":{"properties":{"description":{"type":"string"},"id":{"type":
"string"},"name":{"type":"string"}}}} . I see the same structure as output
for curl -XGET http://localhost:9200/_mapping

With default setting, I tried adding index (json as below) and in
console could not see any exception

"id":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","description":"sample
test","name":"test it".

But
curl -XGET
http://localhost:9200/test/type1/TEST2113-FFC4-4EE1-94A5-764D9EFD2C70 returns
{"_index":"test","_type":"asset","type1":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","exists":
false}. Thus looks like index is not getting created.

I could see in the console [Flambe] [Test] creating index, cause
[auto(index api)], shards [1]/[1], mappings []. Does this mean Java api is
not able to pick the mapping

Here is the code snippet I am using to add the index

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.store.type", "simplefs")
.put("index.store.fs.memory.enabled", "false")
.put("gateway.type", "none")
.put("path.data", "E:\elasticsearch-0.20.5\temp\data")
.put("path.work", "E:\elasticsearch-0.20.5\temp\work")
.put("path.logs", "E:\elasticsearch-0.20.5\temp\logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "1")
.put("node.local", true).build();
Client client =
NodeBuilder.nodeBuilder().settings(settings).node().client();
IndexRequestBuilder builder = client.prepareIndex();
builder.setIndex("test");
builder.setType("type1");
builder.setId("TEST2113-FFC4-4EE1-94A5-764D9EFD2C70");
builder.setSource(jsonString);
builder.setRefresh(true);
IndexResponse resp = client.index(builder.request()).get();

Please help

On Friday, March 22, 2013 12:37:47 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some
snippets, how you are initiating your connection to the elasticsearch node?
This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana ambha....@gmail.com wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT '
http://localhost:9200/test/''. I could also see empty mapping for
'''test' when I run curl -XGET http://localhost:9200/_mapping
, but
the call to 'client.admin().indices().prepareExists("test").execute().actionGet().exists()'
returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

'

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

thanks both of you for quick responses...

Now I added cluster and node in in settings

.put("node.name", "mynode")
.put("node.data", true)
.put("cluster.name", "elasticsearch")

I have also set just the node name as "mynode" in elasticsearch.yml so that
by default it will consider "elasticsearch" cluster

In log I see "mynode" as node in elasticsearch cluster and also curl -XGET
http://localhost:9200/_cluster/nodes confirms the same

There are no errors I see below lines and XGET returns exists:false

  • [mynode] [test] creating index, cause [auto(index api)], shards [1]/[0],
    mappings []
    -[mynode] [test] update_mapping [asset] (dynamic)

With all these changes I am still not able to index valid data

On Friday, March 22, 2013 2:22:32 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

looking at your java code you are actually creating your own instance,
instead of connecting to your existing elasticsearch instance. See this
line which creates an elasticsearch node:

NodeBuilder.nodeBuilder().settings(settings).node()

If the node you created is not joining as a cluster with your already
running elasticsearch instance, it will not see the created index and
therefore show your error. Take a look at your logfiles if you are seeing
any cluster joins. Also I think you need to call node.start() in order to
fire it up.

--Alex

On Fri, Mar 22, 2013 at 9:37 AM, Chetana <ambha....@gmail.com<javascript:>

wrote:

I am getting 200 OK.

For standalone, I created a single node cluster, I have set cluster name
and node.anme in elasticsearch.yml. Looks like that is the problem, if I
restore to default (no cluster and node name set in elasticsearch.yml) I
get true for indices....exist().

My mapping is
{"type1":{"properties":{"description":{"type":"string"},"id":{"type":
"string"},"name":{"type":"string"}}}} . I see the same structure as
output for curl -XGET http://localhost:9200/_mapping

With default setting, I tried adding index (json as below) and in
console could not see any exception

"id":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","description":"sample
test","name":"test it".

But
curl -XGET
http://localhost:9200/test/type1/TEST2113-FFC4-4EE1-94A5-764D9EFD2C70 returns
{"_index":"test","_type":"asset","type1":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","exists":
false}. Thus looks like index is not getting created.

I could see in the console [Flambe] [Test] creating index, cause
[auto(index api)], shards [1]/[1], mappings []. Does this mean Java api is
not able to pick the mapping

Here is the code snippet I am using to add the index

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.store.type", "simplefs")
.put("index.store.fs.memory.enabled", "false")
.put("gateway.type", "none")
.put("path.data", "E:\elasticsearch-0.20.5\temp\data")
.put("path.work", "E:\elasticsearch-0.20.5\temp\work")
.put("path.logs", "E:\elasticsearch-0.20.5\temp\logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "1")
.put("node.local", true).build();
Client client =
NodeBuilder.nodeBuilder().settings(settings).node().client();
IndexRequestBuilder builder = client.prepareIndex();
builder.setIndex("test");
builder.setType("type1");
builder.setId("TEST2113-FFC4-4EE1-94A5-764D9EFD2C70");
builder.setSource(jsonString);
builder.setRefresh(true);
IndexResponse resp = client.index(builder.request()).get();

Please help

On Friday, March 22, 2013 12:37:47 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some
snippets, how you are initiating your connection to the elasticsearch node?
This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana ambha....@gmail.com wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT '
http://localhost:9200/test/''. I could also see empty mapping for
'''test' when I run curl -XGET http://localhost:9200/_mapping
, but
the call to 'client.admin().indices().*prepareExists("test").execute(
*).actionGet().exists()' returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone
mode

'

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

When I use tranportclient instead of NodeClient data gets inserted. Do you
advice using TransportClient instead of NodeClient even for single node
cluster

Which one (node or transport) is better when indexing is done from web
application?

Does the TransportClient have runtime overhead compared to NodeClient?

On Friday, March 22, 2013 3:03:24 PM UTC+5:30, Chetana wrote:

thanks both of you for quick responses...

Now I added cluster and node in in settings

.put("node.name", "mynode")
.put("node.data", true)
.put("cluster.name", "elasticsearch")

I have also set just the node name as "mynode" in elasticsearch.yml so
that by default it will consider "elasticsearch" cluster

In log I see "mynode" as node in elasticsearch cluster and also curl -XGET
http://localhost:9200/_cluster/nodes confirms the same

There are no errors I see below lines and XGET returns exists:false

  • [mynode] [test] creating index, cause [auto(index api)], shards [1]/[0],
    mappings []
    -[mynode] [test] update_mapping [asset] (dynamic)

With all these changes I am still not able to index valid data

On Friday, March 22, 2013 2:22:32 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

looking at your java code you are actually creating your own instance,
instead of connecting to your existing elasticsearch instance. See this
line which creates an elasticsearch node:

NodeBuilder.nodeBuilder().settings(settings).node()

If the node you created is not joining as a cluster with your already
running elasticsearch instance, it will not see the created index and
therefore show your error. Take a look at your logfiles if you are seeing
any cluster joins. Also I think you need to call node.start() in order to
fire it up.

--Alex

On Fri, Mar 22, 2013 at 9:37 AM, Chetana ambha....@gmail.com wrote:

I am getting 200 OK.

For standalone, I created a single node cluster, I have
set cluster name and node.anme in elasticsearch.yml. Looks like that is the
problem, if I restore to default (no cluster and node name set in
elasticsearch.yml) I get true for indices....exist().

My mapping is
{"type1":{"properties":{"description":{"type":"string"},"id":{"type":
"string"},"name":{"type":"string"}}}} . I see the same structure as
output for curl -XGET http://localhost:9200/_mapping

With default setting, I tried adding index (json as below) and in
console could not see any exception

"id":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","description":"sample
test","name":"test it".

But
curl -XGET
http://localhost:9200/test/type1/TEST2113-FFC4-4EE1-94A5-764D9EFD2C70 returns
{"_index":"test","_type":"asset","type1":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","exists":
false}. Thus looks like index is not getting created.

I could see in the console [Flambe] [Test] creating index, cause
[auto(index api)], shards [1]/[1], mappings []. Does this mean Java api is
not able to pick the mapping

Here is the code snippet I am using to add the index

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.store.type", "simplefs")
.put("index.store.fs.memory.enabled", "false")
.put("gateway.type", "none")
.put("path.data", "E:\elasticsearch-0.20.5\temp\data")
.put("path.work", "E:\elasticsearch-0.20.5\temp\work")
.put("path.logs", "E:\elasticsearch-0.20.5\temp\logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "1")
.put("node.local", true).build();
Client client =
NodeBuilder.nodeBuilder().settings(settings).node().client();
IndexRequestBuilder builder = client.prepareIndex();
builder.setIndex("test");
builder.setType("type1");
builder.setId("TEST2113-FFC4-4EE1-94A5-764D9EFD2C70");
builder.setSource(jsonString);
builder.setRefresh(true);
IndexResponse resp = client.index(builder.request()).get();

Please help

On Friday, March 22, 2013 12:37:47 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some
snippets, how you are initiating your connection to the elasticsearch node?
This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana ambha....@gmail.com wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT '
http://localhost:9200/test/''. I could also see empty mapping for
'''test' when I run curl -XGET http://localhost:9200/_mapping
, but
the call to 'client.admin().indices().**prepareExists("test").execute(
**).actionGet().exists()' returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone
mode

'

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

thanks both of you for quick responses...
Now I added cluster and node in in settings

.put("node.name http://node.name/", "mynode")
.put("node.data", true)
.put("cluster.name http://cluster.name/", "elasticsearch")

I have also set just the node name as "mynode" in elasticsearch.yml so that
by default it will consider "elasticsearch" cluster

In log I see "mynode" as node in elasticsearch cluster and also curl -XGET *
http://localhost:9200/_cluster/nodes* http://localhost:9200/_cluster/nodesconfirms the same

There are no errors I see below lines and XGET returns exists:false

  • [mynode] [test] creating index, cause [auto(index api)], shards [1]/[0],
    mappings []
    -[mynode] [test] update_mapping [asset] (dynamic)

With all these changes I am still not able to index valid data
When I use tranportclient instead of NodeClient data gets inserted. Do you
advice using TransportClient instead of NodeClient even for single node
cluster
Which one (node or transport) is better when indexing is done from web
application?
Does the TransportClient have runtime overhead compared to NodeClient?
For creating index both NodeClient and TransportClient works. Internally
both use admin().IndicesAdminClient. But for adding index data only
TransportClient works.
Is there any bug in the code or only TransportClient is allowed to add the
index?

On Friday, March 22, 2013 2:22:32 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

looking at your java code you are actually creating your own instance,
instead of connecting to your existing elasticsearch instance. See this
line which creates an elasticsearch node:

NodeBuilder.nodeBuilder().settings(settings).node()

If the node you created is not joining as a cluster with your already
running elasticsearch instance, it will not see the created index and
therefore show your error. Take a look at your logfiles if you are seeing
any cluster joins. Also I think you need to call node.start() in order to
fire it up.

--Alex

On Fri, Mar 22, 2013 at 9:37 AM, Chetana <ambha....@gmail.com<javascript:>

wrote:

I am getting 200 OK.

For standalone, I created a single node cluster, I have set cluster name
and node.anme in elasticsearch.yml. Looks like that is the problem, if I
restore to default (no cluster and node name set in elasticsearch.yml) I
get true for indices....exist().

My mapping is
{"type1":{"properties":{"description":{"type":"string"},"id":{"type":
"string"},"name":{"type":"string"}}}} . I see the same structure as
output for curl -XGET http://localhost:9200/_mapping

With default setting, I tried adding index (json as below) and in
console could not see any exception

"id":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","description":"sample
test","name":"test it".

But
curl -XGET
http://localhost:9200/test/type1/TEST2113-FFC4-4EE1-94A5-764D9EFD2C70 returns
{"_index":"test","_type":"asset","type1":"TEST2113-FFC4-4EE1-94A5-764D9EFD2C70","exists":
false}. Thus looks like index is not getting created.

I could see in the console [Flambe] [Test] creating index, cause
[auto(index api)], shards [1]/[1], mappings []. Does this mean Java api is
not able to pick the mapping

Here is the code snippet I am using to add the index

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.store.type", "simplefs")
.put("index.store.fs.memory.enabled", "false")
.put("gateway.type", "none")
.put("path.data", "E:\elasticsearch-0.20.5\temp\data")
.put("path.work", "E:\elasticsearch-0.20.5\temp\work")
.put("path.logs", "E:\elasticsearch-0.20.5\temp\logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "1")
.put("node.local", true).build();
Client client =
NodeBuilder.nodeBuilder().settings(settings).node().client();
IndexRequestBuilder builder = client.prepareIndex();
builder.setIndex("test");
builder.setType("type1");
builder.setId("TEST2113-FFC4-4EE1-94A5-764D9EFD2C70");
builder.setSource(jsonString);
builder.setRefresh(true);
IndexResponse resp = client.index(builder.request()).get();

Please help

On Friday, March 22, 2013 12:37:47 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

when you do
curl -X HEAD -v localhost:9200/test

Are you getting back a HTTP 200? Apart from that, can you post some
snippets, how you are initiating your connection to the elasticsearch node?
This might help in order to find your problem..

--Alex

On Fri, Mar 22, 2013 at 7:35 AM, Chetana ambha....@gmail.com wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT '
http://localhost:9200/test/''. I could also see empty mapping for
'''test' when I run curl -XGET http://localhost:9200/_mapping
, but
the call to 'client.admin().indices().*prepareExists("test").execute(
*).actionGet().exists()' returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone
mode

'

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.