Querying indexed data in different computer Elasticsearch

Hi

In elastic search java api, suppose I am building the indexed data using
this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client
on other computer.
Is there any way in which I can give the path and the already indexed data
can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code
on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit[] results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all
shards failed
Please tell me how can I transfer just the indexed data from one computer
to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Hi david

Thanks for the reply. Actually my problem is that I first have to index
data on my server, then I will be deploying this data so that other users
can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your
data.

Start a client node or a transport client, which connects to your running
cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using
this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client
on other computer.
Is there any way in which I can give the path and the already indexed data
can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following
code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all
shards failed
Please tell me how can I transfer just the indexed data from one computer
to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

I want them to use Elasticsearch standalone. They will just download my
code and the indexed data and then with the help of my code they will query
the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:

It means that your users are connected on the same network or that you
want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index
data on my server, then I will be deploying this data so that other users
can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your
data.

Start a client node or a transport client, which connects to your running
cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using
this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already indexed
data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following
code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query],
all shards failed
Please tell me how can I transfer just the indexed data from one computer
to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my code and the indexed data and then with the help of my code they will query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:
It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir

    • Node node =
      nodeBuilder().clusterName("./resources/firstcommit").node();
    • Client client = node.client();
    • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    • SearchRequestBuilder srb =
      client.prepareSearch("twitter").setTypes("tweet");
    • SearchResponse big = srb.setQuery(qb).execute().actionGet();
    • SearchHit results = big.getHits().getHits();
  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all
    shards failed

I read somewhere that this should work, any idea where I am going wrong?
Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my
code and the indexed data and then with the help of my code they will query
the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:

It means that your users are connected on the same network or that you
want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index
data on my server, then I will be deploying this data so that other users
can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your
data.

Start a client node or a transport client, which connects to your
running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using
this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already indexed
data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following
code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query],
all shards failed
Please tell me how can I transfer just the indexed data from one
computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir
    Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
    Client client = node.client();
    MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
    SearchResponse big = srb.setQuery(qb).execute().actionGet();
    SearchHit results = big.getHits().getHits();

  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

I read somewhere that this should work, any idea where I am going wrong?

Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato <david@pilato.fr mailto:david@pilato.fr> wrote:
In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal <gkkartiks@gmail.com mailto:gkkartiks@gmail.com> a écrit :

I want them to use Elasticsearch standalone. They will just download my code and the indexed data and then with the help of my code they will query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato <david@pilato.fr mailto:david@pilato.fr> wrote:
It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal <gkkartiks@gmail.com mailto:gkkartiks@gmail.com> a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato <david@pilato.fr mailto:david@pilato.fr> wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal <gkkartiks@gmail.com mailto:gkkartiks@gmail.com> a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer.

For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer.

For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/ https://discuss.elastic.co/

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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

David the cluster name was just for experimental purpose as I am trying to
learn what is happening and I am specifying the path from the present
folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its
just an example but the main algo is same) :

*Node node =
nodeBuilder().clusterName("./resources/firstcommit").node(); Client
client = node.client(); IndexResponse response =
client.prepareIndex("twitter", "tweet", 1)
.setSource(jsonBuilder()
.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
node.close(); *

Now I ran the above code in different computer with data copied to the same
path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing
some silly mistake here but I am not able to identify it as I am new to the
ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:

No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough
time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir

    • Node node =
      nodeBuilder().clusterName("./resources/firstcommit").node();
    • Client client = node.client();
    • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    • SearchRequestBuilder srb =
      client.prepareSearch("twitter").setTypes("tweet");
    • SearchResponse big = srb.setQuery(qb).execute().actionGet();
    • SearchHit results = big.getHits().getHits();
  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all
    shards failed

I read somewhere that this should work, any idea where I am going wrong?
Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my
code and the indexed data and then with the help of my code they will query
the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:

It means that your users are connected on the same network or that you
want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index
data on my server, then I will be deploying this data so that other users
can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index
your data.

Start a client node or a transport client, which connects to your
running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data
using this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already indexed
data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following
code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query],
all shards failed
Please tell me how can I transfer just the indexed data from one
computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying to learn what is happening and I am specifying the path from the present folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its just an example but the main algo is same) :

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();
node.close(); 

Now I ran the above code in different computer with data copied to the same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing some silly mistake here but I am not able to identify it as I am new to the ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:
No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir
    Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
    Client client = node.client();
    MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
    SearchResponse big = srb.setQuery(qb).execute().actionGet();
    SearchHit results = big.getHits().getHits();

  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

I read somewhere that this should work, any idea where I am going wrong?

Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:
In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my code and the indexed data and then with the help of my code they will query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:
It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Yeah user is different on purpose. I am making a Ques Ans tool and indexing
is a part of it. Now I dont have any central server currently to which each
user can connect to. SO I have to deploy the indexed data and the query
code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter the
query code like this in first node :

 * Node node = nodeBuilder().clusterName("./*

resources/firstcommit").node()

*; Client client = node.client(); *

IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
.setSource(jsonBuilder()
.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb =
client.prepareSearch("twitter").setTypes("tweet"); SearchResponse big =
srb.setQuery(qb).execute().actionGet(); SearchHit[] results =
big.getHits().getHits();

  • /* print results /
  • node.close();*

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:

user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying to
learn what is happening and I am specifying the path from the present
folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its
just an example but the main algo is same) :

*Node node =
nodeBuilder().clusterName("./resources/firstcommit").node(); Client
client = node.client(); IndexResponse response =
client.prepareIndex("twitter", "tweet", 1)
.setSource(jsonBuilder()
.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
node.close(); *

Now I ran the above code in different computer with data copied to the
same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing
some silly mistake here but I am not able to identify it as I am new to the
ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:

No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough
time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir

    • Node node =
      nodeBuilder().clusterName("./resources/firstcommit").node();
    • Client client = node.client();
    • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    • SearchRequestBuilder srb =
      client.prepareSearch("twitter").setTypes("tweet");
    • SearchResponse big = srb.setQuery(qb).execute().actionGet();
    • SearchHit results = big.getHits().getHits();
  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all
    shards failed

I read somewhere that this should work, any idea where I am going wrong?
Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my
code and the indexed data and then with the help of my code they will query
the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:

It means that your users are connected on the same network or that you
want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index
data on my server, then I will be deploying this data so that other users
can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index
your data.

Start a client node or a transport client, which connects to your
running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data
using this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already indexed
data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following
code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user",
    "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query],
all shards failed
Please tell me how can I transfer just the indexed data from one
computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I meant something else. At first you indexed kimchy and search for kimchi.

Check your file access rights. Might be your issue.

And please remove the clustername or use a simple one like "mycluster".

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 22:32, Kartik Singhal gkkartiks@gmail.com a écrit :

Yeah user is different on purpose. I am making a Ques Ans tool and indexing is a part of it. Now I dont have any central server currently to which each user can connect to. SO I have to deploy the indexed data and the query code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter the query code like this in first node :

 Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
 Client client = node.client();
 IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();

MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit[] results = big.getHits().getHits();

/*     print results     */
node.close();

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:
user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying to learn what is happening and I am specifying the path from the present folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its just an example but the main algo is same) :

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();
node.close(); 

Now I ran the above code in different computer with data copied to the same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing some silly mistake here but I am not able to identify it as I am new to the ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:
No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir
    Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
    Client client = node.client();
    MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
    SearchResponse big = srb.setQuery(qb).execute().actionGet();
    SearchHit results = big.getHits().getHits();

  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

I read somewhere that this should work, any idea where I am going wrong?

Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:
In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my code and the indexed data and then with the help of my code they will query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:
It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Yes. I first indexed kimchy and queried for kimchy, it is working fine.

Also I tried naming the cluster with simply "mycluster", still not working.

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 2:20 AM, David Pilato david@pilato.fr wrote:

I meant something else. At first you indexed kimchy and search for kimchi.

Check your file access rights. Might be your issue.

And please remove the clustername or use a simple one like "mycluster".

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 22:32, Kartik Singhal gkkartiks@gmail.com a écrit :

Yeah user is different on purpose. I am making a Ques Ans tool and
indexing is a part of it. Now I dont have any central server currently to
which each user can connect to. SO I have to deploy the indexed data and
the query code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter
the query code like this in first node :

 * Node node = nodeBuilder().clusterName("./*

resources/firstcommit").node()

*; Client client = node.client(); *

*IndexResponse response = client.prepareIndex("twitter", "tweet",

  1.    .setSource(jsonBuilder()
    

.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb =
client.prepareSearch("twitter").setTypes("tweet"); SearchResponse big =
srb.setQuery(qb).execute().actionGet(); SearchHit results =
big.getHits().getHits();*

  • /* print results /
  • node.close();*

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:

user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying
to learn what is happening and I am specifying the path from the present
folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its
just an example but the main algo is same) :

*Node node =
nodeBuilder().clusterName("./resources/firstcommit").node(); Client
client = node.client(); IndexResponse response =
client.prepareIndex("twitter", "tweet", 1)
.setSource(jsonBuilder()
.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
node.close(); *

Now I ran the above code in different computer with data copied to the
same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing
some silly mistake here but I am not able to identify it as I am new to the
ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:

No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough
time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir

    • Node node =
      nodeBuilder().clusterName("./resources/firstcommit").node();
    • Client client = node.client();
    • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    • SearchRequestBuilder srb =
      client.prepareSearch("twitter").setTypes("tweet");
    • SearchResponse big = srb.setQuery(qb).execute().actionGet();
    • SearchHit results = big.getHits().getHits();
  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all
    shards failed

I read somewhere that this should work, any idea where I am going wrong?
Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my
code and the indexed data and then with the help of my code they will query
the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:

It means that your users are connected on the same network or that you
want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to
index data on my server, then I will be deploying this data so that other
users can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index
your data.

Start a client node or a transport client, which connects to your
running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a
écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data
using this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already indexed
data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the
following code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user",
    "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase
[query], all shards failed
Please tell me how can I transfer just the indexed data from one
computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Can you describe all steps you do, one by one, with all commands you run?
Also paste all your logs?

David

Le 24 mai 2015 à 23:17, Kartik Singhal gkkartiks@gmail.com a écrit :

Yes. I first indexed kimchy and queried for kimchy, it is working fine.

Also I tried naming the cluster with simply "mycluster", still not working.

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 2:20 AM, David Pilato david@pilato.fr wrote:
I meant something else. At first you indexed kimchy and search for kimchi.

Check your file access rights. Might be your issue.

And please remove the clustername or use a simple one like "mycluster".

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 22:32, Kartik Singhal gkkartiks@gmail.com a écrit :

Yeah user is different on purpose. I am making a Ques Ans tool and indexing is a part of it. Now I dont have any central server currently to which each user can connect to. SO I have to deploy the indexed data and the query code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter the query code like this in first node :

 Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
 Client client = node.client();
 IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();

MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit[] results = big.getHits().getHits();

/*     print results     */
node.close();

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:
user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying to learn what is happening and I am specifying the path from the present folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its just an example but the main algo is same) :

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();
node.close(); 

Now I ran the above code in different computer with data copied to the same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing some silly mistake here but I am not able to identify it as I am new to the ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:
No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir
    Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
    Client client = node.client();
    MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
    SearchResponse big = srb.setQuery(qb).execute().actionGet();
    SearchHit results = big.getHits().getHits();

  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

I read somewhere that this should work, any idea where I am going wrong?

Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:
In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my code and the indexed data and then with the help of my code they will query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:
It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9123CC97-597E-49F8-991C-3C33CCD949B8%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Steps:

  1. I start the node and collect the client of ES using this:
  • Node node = nodeBuilder().clusterName("mycluster").node(); Client
    client = node.client(); *
  1. Index the data using Indexresponse command

IndexResponse response = client.prepareIndex("classes", "mappings",
String.valueOf(i)) .setSource(jsonBuilder()
.startObject() .field("uri",
token1) .field("label", token2)
.endObject() ) .execute() .actionGet();

  1. Closing the node

    node.close();

  2. Run the code successfully.

  3. In a different code on the same computer, start a new node

Node node = nodeBuilder().clusterName("mycluster").node(); Client
client = node.client();

*6. *Extract the results

  • MatchQueryBuilder qb = QueryBuilders.matchQuery("label",
    "politician"); SearchRequestBuilder srb =
    client.prepareSearch("classes").setTypes("mappings"); SearchResponse big
    = srb.setQuery(qb).execute().actionGet(); SearchHit results =
    big.getHits().getHits(); *
    *7. *closing the node

node.close();
8. Run the code with following exception :

SearchPhaseExecutionException: Failed to execute phase [query], all
shards failed

I am building the maven project where I use elasticsearch maven
repositories so I dont know where elasticsearch places its log files on
that and I cannot use logstash currently.

Thanks
Kartik

On Mon, May 25, 2015 at 8:00 AM, David Pilato david@pilato.fr wrote:

Can you describe all steps you do, one by one, with all commands you run?
Also paste all your logs?

David

Le 24 mai 2015 à 23:17, Kartik Singhal gkkartiks@gmail.com a écrit :

Yes. I first indexed kimchy and queried for kimchy, it is working fine.

Also I tried naming the cluster with simply "mycluster", still not working.

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 2:20 AM, David Pilato david@pilato.fr wrote:

I meant something else. At first you indexed kimchy and search for kimchi.

Check your file access rights. Might be your issue.

And please remove the clustername or use a simple one like "mycluster".

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 22:32, Kartik Singhal gkkartiks@gmail.com a écrit :

Yeah user is different on purpose. I am making a Ques Ans tool and
indexing is a part of it. Now I dont have any central server currently to
which each user can connect to. SO I have to deploy the indexed data and
the query code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter
the query code like this in first node :

 * Node node = nodeBuilder().clusterName("./*

resources/firstcommit").node()

*; Client client = node.client(); *

*IndexResponse response = client.prepareIndex("twitter", "tweet",

  1.    .setSource(jsonBuilder()
    

.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb =
client.prepareSearch("twitter").setTypes("tweet"); SearchResponse big =
srb.setQuery(qb).execute().actionGet(); SearchHit results =
big.getHits().getHits();*

  • /* print results /
  • node.close();*

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:

user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying
to learn what is happening and I am specifying the path from the present
folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its
just an example but the main algo is same) :

*Node node =
nodeBuilder().clusterName("./resources/firstcommit").node(); Client
client = node.client(); IndexResponse response =
client.prepareIndex("twitter", "tweet", 1)
.setSource(jsonBuilder()
.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
node.close(); *

Now I ran the above code in different computer with data copied to the
same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing
some silly mistake here but I am not able to identify it as I am new to the
ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:

No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting
enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir

    • Node node =
      nodeBuilder().clusterName("./resources/firstcommit").node();
    • Client client = node.client();
    • MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    • SearchRequestBuilder srb =
      client.prepareSearch("twitter").setTypes("tweet");
    • SearchResponse big = srb.setQuery(qb).execute().actionGet();
    • SearchHit results = big.getHits().getHits();
  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query],
    all shards failed

I read somewhere that this should work, any idea where I am going wrong?
Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download
my code and the indexed data and then with the help of my code they will
query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:

It means that your users are connected on the same network or that
you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a
écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to
index data on my server, then I will be deploying this data so that other
users can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr
wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index
your data.

Start a client node or a transport client, which connects to your
running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a
écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data
using this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already
indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the
following code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user",
    "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase
[query], all shards failed
Please tell me how can I transfer just the indexed data from one
computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/9123CC97-597E-49F8-991C-3C33CCD949B8%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/9123CC97-597E-49F8-991C-3C33CCD949B8%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0YsCWMXjx17Q2rLCZBf_Tyhv0A3hnwWeK62af2Es9fMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

So you run this from the same dir?
Within the same Maven project ?
I thought you were copying data from on point to another.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 mai 2015 à 06:12, Kartik Singhal gkkartiks@gmail.com a écrit :

Steps:

  1. I start the node and collect the client of ES using this:

    Node node = nodeBuilder().clusterName("mycluster").node();
    Client client = node.client();

  2. Index the data using Indexresponse command

    IndexResponse response = client.prepareIndex("classes", "mappings", String.valueOf(i))
    .setSource(jsonBuilder()
    .startObject()
    .field("uri", token1)
    .field("label", token2)
    .endObject()
    )
    .execute()
    .actionGet();

  3. Closing the node

    node.close();

  4. Run the code successfully.

  5. In a different code on the same computer, start a new node

    Node node = nodeBuilder().clusterName("mycluster").node();
    Client client = node.client();

  6. Extract the results

    MatchQueryBuilder qb = QueryBuilders.matchQuery("label", "politician");
    SearchRequestBuilder srb = client.prepareSearch("classes").setTypes("mappings");
    SearchResponse big = srb.setQuery(qb).execute().actionGet();
    SearchHit results = big.getHits().getHits();

  7. closing the node

    node.close();

  8. Run the code with following exception :

    SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

I am building the maven project where I use elasticsearch maven repositories so I dont know where elasticsearch places its log files on that and I cannot use logstash currently.

Thanks
Kartik

On Mon, May 25, 2015 at 8:00 AM, David Pilato david@pilato.fr wrote:
Can you describe all steps you do, one by one, with all commands you run?
Also paste all your logs?

David

Le 24 mai 2015 à 23:17, Kartik Singhal gkkartiks@gmail.com a écrit :

Yes. I first indexed kimchy and queried for kimchy, it is working fine.

Also I tried naming the cluster with simply "mycluster", still not working.

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 2:20 AM, David Pilato david@pilato.fr wrote:
I meant something else. At first you indexed kimchy and search for kimchi.

Check your file access rights. Might be your issue.

And please remove the clustername or use a simple one like "mycluster".

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 22:32, Kartik Singhal gkkartiks@gmail.com a écrit :

Yeah user is different on purpose. I am making a Ques Ans tool and indexing is a part of it. Now I dont have any central server currently to which each user can connect to. SO I have to deploy the indexed data and the query code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter the query code like this in first node :

 Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
 Client client = node.client();
 IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();

MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit[] results = big.getHits().getHits();

/*     print results     */
node.close();

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:
user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying to learn what is happening and I am specifying the path from the present folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data (Its just an example but the main algo is same) :

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
IndexResponse response = client.prepareIndex("twitter", "tweet", 1)
    .setSource(jsonBuilder()
                .startObject()
                    .field("user", "kimchi")
                    .field("label", "kim")
                .endObject()
              )
    .execute()
    .actionGet();
node.close(); 

Now I ran the above code in different computer with data copied to the same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am doing some silly mistake here but I am not able to identify it as I am new to the ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:
No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir
    Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
    Client client = node.client();
    MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
    SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
    SearchResponse big = srb.setQuery(qb).execute().actionGet();
    SearchHit results = big.getHits().getHits();

  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

I read somewhere that this should work, any idea where I am going wrong?

Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:
In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a écrit :

I want them to use Elasticsearch standalone. They will just download my code and the indexed data and then with the help of my code they will query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr wrote:
It means that your users are connected on the same network or that you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to index data on my server, then I will be deploying this data so that other users can query it on their different different computers using the code I provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr wrote:
I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index your data.

Start a client node or a transport client, which connects to your running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data using this client

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();

IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
.setSource(jsonBuilder()
.startObject()
.field("user", "kimchy")
.field("postDate", new Date())
.field("message", "trying out Elasticsearch")
.endObject()
)
.execute()
.actionGet();
This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other client on other computer.
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

Node node = nodeBuilder().clusterName("./resources/firstcommit").node();
Client client = node.client();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");
SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");
SearchResponse big = srb.setQuery(qb).execute().actionGet();
SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

Please tell me how can I transfer just the indexed data from one computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9123CC97-597E-49F8-991C-3C33CCD949B8%40pilato.fr.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0YsCWMXjx17Q2rLCZBf_Tyhv0A3hnwWeK62af2Es9fMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/973E69F6-E3F2-4937-BB30-9AE9CE56F8EC%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Yeah same dir and same maven project.
My final goal is to copy data from one point to another only. But for that
first this thing has to work.

thanks
regards,
Kartik

On Mon, May 25, 2015 at 11:59 AM, David Pilato david@pilato.fr wrote:

So you run this from the same dir?
Within the same Maven project ?
I thought you were copying data from on point to another.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 mai 2015 à 06:12, Kartik Singhal gkkartiks@gmail.com a écrit :

Steps:

  1. I start the node and collect the client of ES using this:
  • Node node = nodeBuilder().clusterName("mycluster").node(); Client
    client = node.client(); *
  1. Index the data using Indexresponse command

IndexResponse response = client.prepareIndex("classes", "mappings",
String.valueOf(i)) .setSource(jsonBuilder()
.startObject() .field("uri",
token1) .field("label", token2)
.endObject() ) .execute() .actionGet();

  1. Closing the node

    node.close();

  2. Run the code successfully.

  3. In a different code on the same computer, start a new node

Node node = nodeBuilder().clusterName("mycluster").node(); Client
client = node.client();

*6. *Extract the results

  • MatchQueryBuilder qb = QueryBuilders.matchQuery("label",
    "politician"); SearchRequestBuilder srb =
    client.prepareSearch("classes").setTypes("mappings"); SearchResponse big
    = srb.setQuery(qb).execute().actionGet(); SearchHit results =
    big.getHits().getHits(); *
    *7. *closing the node

node.close();
8. Run the code with following exception :

SearchPhaseExecutionException: Failed to execute phase [query], all
shards failed

I am building the maven project where I use elasticsearch maven
repositories so I dont know where elasticsearch places its log files on
that and I cannot use logstash currently.

Thanks
Kartik

On Mon, May 25, 2015 at 8:00 AM, David Pilato david@pilato.fr wrote:

Can you describe all steps you do, one by one, with all commands you run?
Also paste all your logs?

David

Le 24 mai 2015 à 23:17, Kartik Singhal gkkartiks@gmail.com a écrit :

Yes. I first indexed kimchy and queried for kimchy, it is working fine.

Also I tried naming the cluster with simply "mycluster", still not
working.

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 2:20 AM, David Pilato david@pilato.fr wrote:

I meant something else. At first you indexed kimchy and search for
kimchi.

Check your file access rights. Might be your issue.

And please remove the clustername or use a simple one like "mycluster".

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 22:32, Kartik Singhal gkkartiks@gmail.com a écrit :

Yeah user is different on purpose. I am making a Ques Ans tool and
indexing is a part of it. Now I dont have any central server currently to
which each user can connect to. SO I have to deploy the indexed data and
the query code to the user in my system.
Is their any other better way you feel I can do.

Also yes the query code in the first node is working fine, when I enter
the query code like this in first node :

 * Node node = nodeBuilder().clusterName("./*

resources/firstcommit").node()

*; Client client = node.client(); *

*IndexResponse response = client.prepareIndex("twitter", "tweet",

  1.    .setSource(jsonBuilder()
    

.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchi");
SearchRequestBuilder srb =
client.prepareSearch("twitter").setTypes("tweet"); SearchResponse big =
srb.setQuery(qb).execute().actionGet(); SearchHit results =
big.getHits().getHits();*

  • /* print results /
  • node.close();*

Thanks
regards,
Kartik

On Mon, May 25, 2015 at 1:53 AM, David Pilato david@pilato.fr wrote:

user is different. On purpose?

Is the query working fine on the first node?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 21:23, Kartik Singhal gkkartiks@gmail.com a écrit :

David the cluster name was just for experimental purpose as I am trying
to learn what is happening and I am specifying the path from the present
folder in that name, so as to instruct code where to put the data.

Indexes have a yellow status. I ran this code for indexing the data
(Its just an example but the main algo is same) :

*Node node =
nodeBuilder().clusterName("./resources/firstcommit").node(); Client
client = node.client(); IndexResponse response =
client.prepareIndex("twitter", "tweet", 1)
.setSource(jsonBuilder()
.startObject() .field("user",
"kimchi") .field("label", "kim")
.endObject() ) .execute() .actionGet();
node.close(); *

Now I ran the above code in different computer with data copied to the
same path with the exception I mentioned.
What in your opinion I should do?

Thanks for your reply, really helping me a lot. Sorry, I know I am
doing some silly mistake here but I am not able to identify it as I am new
to the ES.
regards,
Kartik

On Sun, May 24, 2015 at 8:05 PM, David Pilato david@pilato.fr wrote:

No I have no idea.
But for sure I would never use such a cluster name!

May be your cluster is not really started and you are not waiting
enough time for you index to have at least a yellow status?

--
David Pilato - Developer | Evangelist
elastic.co http://elastic.co
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 24 mai 2015 à 14:00, Kartik Singhal gkkartiks@gmail.com a écrit :

David I did that only. See my original mail in this thread.

  • I copied the whole data dir which is XYZ/resources/firstcommit

  • Then I used this code on that dir

    • Node node =
      nodeBuilder().clusterName("./resources/firstcommit").node();
    • Client client = node.client();
    • MatchQueryBuilder qb = QueryBuilders.matchQuery("user",
      "kimchy");
    • SearchRequestBuilder srb =
      client.prepareSearch("twitter").setTypes("tweet");
    • SearchResponse big = srb.setQuery(qb).execute().actionGet();
    • SearchHit results = big.getHits().getHits();
  • This produced the following error

    SearchPhaseExecutionException: Failed to execute phase [query],
    all shards failed

I read somewhere that this should work, any idea where I am going
wrong?
Thanks
Kartik

On Sun, May 24, 2015 at 5:00 PM, David Pilato david@pilato.fr wrote:

In that case:

  • use a simple clustername or let the default one
  • just copy the data dir

It should work.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:36, Kartik Singhal gkkartiks@gmail.com a
écrit :

I want them to use Elasticsearch standalone. They will just download
my code and the indexed data and then with the help of my code they will
query the data.

On Sun, May 24, 2015 at 3:59 PM, David Pilato david@pilato.fr
wrote:

It means that your users are connected on the same network or that
you want them to use Elasticsearch in standalone ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:22, Kartik Singhal gkkartiks@gmail.com a
écrit :

Hi david

Thanks for the reply. Actually my problem is that I first have to
index data on my server, then I will be deploying this data so that other
users can query it on their different different computers using the code I
provide to them. How can I do that?

Thanks
regards,
Kartik

On Sun, May 24, 2015 at 3:45 PM, David Pilato david@pilato.fr
wrote:

I think you misunderstand how Elasticsearch works.

You don't need to share a filesystem across multiple nodes.

Just start a first node with a cluster name like "mycluster". Index
your data.

Start a client node or a transport client, which connects to your
running cluster and you are done.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2015 à 12:00, Kartik Singhal gkkartiks@gmail.com a
écrit :

Hi

In Elasticsearch java api, suppose I am building the indexed data
using this client

Node node = nodeBuilder().clusterName(".

/resources/firstcommit").node();Client client =
node.client();IndexResponse response = client.prepareIndex("twitter",
"tweet", "1") .setSource(jsonBuilder()
.startObject() .field("user",
"kimchy") .field("postDate", new
Date()) .field("message", "trying out
Elasticsearch") .endObject() ) .execute()
.actionGet();

This indexed data is stored in folder XYZ/resources/firstcommit.
My question is how to query this indexed data in java on some other
client on other computer.
Is there any way in which I can give the path and the already
indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the
following code on other computer. This gave the following exception

  • Node node =
    nodeBuilder().clusterName("./resources/firstcommit").node();
  • Client client = node.client();
  • MatchQueryBuilder qb = QueryBuilders.matchQuery("user",
    "kimchy");
  • SearchRequestBuilder srb =
    client.prepareSearch("twitter").setTypes("tweet");
  • SearchResponse big = srb.setQuery(qb).execute().actionGet();
  • SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase
[query], all shards failed
Please tell me how can I transfer just the indexed data from one
computer to another and then query it.

Thank You
regards,
Kartik

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1cLPz__39D9eAZmuw%3Drh10hha1ahGSqHPisASOVVh-pw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/B37D48AF-F31E-462E-9E2F-5EBE91712030%40pilato.fr?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda3Krv%2B%3DgqsnptBNOG8BHM9OaUCqVonNEkZntTrdrFB4KA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/072F8196-A166-4D94-A673-DEEFA76C9B92%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0ZKUon7nW1i2AAgf2v6fkbWgUrmQpKKPLKTeFfjv7t_A%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/6A3857AE-7899-4026-A895-178AE1ACF6C4%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda14Ey3Oq4i%2BsXA%2BPRhVDDvM0v-0%2BY8u2Dsii11hL3B-_w%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/DCAE38B1-FBB8-425E-A7AA-E39026D07616%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda10W%3DnKWFrhzNRc-Li-vGWdJUP2hJOW_WU0PH8XeLA5Ow%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/E29F9E04-6969-4348-B321-5D15248CB4B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0Vaxtt-MW8EaG_uSwuskUfDXaJbYBVGaMenGQ17A3FLg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/69B79794-5106-4D8B-8A53-E464A7E8D5B3%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda2QyZV08XV6NxnkkR11%2Bsn0XKMbDOLUUKxVxq%3DL2mgpXg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to
https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/9123CC97-597E-49F8-991C-3C33CCD949B8%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/9123CC97-597E-49F8-991C-3C33CCD949B8%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0YsCWMXjx17Q2rLCZBf_Tyhv0A3hnwWeK62af2Es9fMw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda0YsCWMXjx17Q2rLCZBf_Tyhv0A3hnwWeK62af2Es9fMw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/973E69F6-E3F2-4937-BB30-9AE9CE56F8EC%40pilato.fr
https://groups.google.com/d/msgid/elasticsearch/973E69F6-E3F2-4937-BB30-9AE9CE56F8EC%40pilato.fr?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
Regards,
Kartik Singhal
Final Year Undergraduate
Computer Science and Engineering
The LNM Institute of Information Technology, Jaipur

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF5%2Bda1yp05PaQ%3Do9ft6FiH4EbSuH2aHVvPZ-%3DqOnuUy_-ZJKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.