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
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
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
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
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
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.
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
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.
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
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.
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
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.
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
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.
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
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.