hi David, i have cleaned mongo Database and elastic server data folder..
and restarted server.. created 5 records in DC_USER table..
SearchResponse response =
client.prepareSearch().setQuery(QueryBuilders.textQuery("firstName",
"admin")).setIndices("dc_user_idx").setTypes("DC_USER").execute().actionGet();
when i call this query its not fetching data..
the output is:
{
"took" : 47,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 2,
"failed" : 3,
"failures" : [ {
"index" : "dc_user_idx",
"shard" : 0,
"status" : 500,
"reason" : "No active shards"
}, {
"index" : "dc_user_idx",
"shard" : 3,
"status" : 500,
"reason" : "No active shards"
}, {
"index" : "dc_user_idx",
"shard" : 4,
"status" : 500,
"reason" : "No active shards"
} ]
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" :
}
}
how to resolve this problem..
On Tuesday, March 12, 2013 11:47:00 AM UTC+5:30, srikanth gone wrote:
HI David, i have created indexes using CURL in one batch file.(.bat)
curl -XPUT "http://localhost:9200/_river/dc_user_river/_meta" -d {
"type": "mongodb",
"mongodb": {
"db": "data-collection",
"collection": "DC_USER"
},
"index": {
"name": "dc_user_idx",
"type": "DC_USER"
}
}
like this ..On Monday, March 11, 2013 9:55:14 PM UTC+5:30, David Pilato wrote:
Sounds like you are creating index in Java, don't you?
If so, wait for a yellow cluster before creating the river and searching
for anything.--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocsLe 11 mars 2013 à 17:17, srikanth gone srika...@gmail.com a écrit :
Hi David..
i have deleted curl.. and restarted.
i have replaced text like this..
SearchResponse response =
client.prepareSearch().setQuery(QueryBuilders.textQuery("firstName",
"Ashok")).setIndices("dc_user_idx").setTypes("DC_USER").execute().actionGet();output..but already record is there
{
"took" : 578,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 3,
"failed" : 2,
"failures" : [ {
"index" : "dc_user_idx",
"shard" : 1,
"status" : 500,
"reason" : "No active shards"
}, {
"index" : "dc_user_idx",
"shard" : 3,
"status" : 500,
"reason" : "No active shards"
} ]
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" :
}
}please help me
On Monday, March 11, 2013 8:58:24 PM UTC+5:30, David Pilato wrote:
You have 4 failing shards. Perhaps the document you are looking for is
in one of theses shards.
You should try to have a yellow cluster before searching in it.Try to restart from scratch.
curl -XDELETE http://localhost:9200/
WARNING: it will delete all your indexes and rivers.
--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocsLe 11 mars 2013 à 16:25, srikanth gone srika...@gmail.com a écrit :
Hi David,
i have tried what you have suggested. its working..
output is{
"took" : 78,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 1,
"failed" : 4,
"failures" : [ {
"index" : "dc_user_idx",
"shard" : 0,
"status" : 500,
"reason" : "No active shards"
}, {
"index" : "dc_user_idx",
"shard" : 1,
"status" : 500,
"reason" : "No active shards"
}, {
"index" : "dc_user_idx",
"shard" : 2,
"status" : 500,
"reason" : "No active shards"
}, {
"index" : "dc_user_idx",
"shard" : 3,
"status" : 500,
"reason" : "No active shards"
} ]
},
"hits" : {
"total" : 1,
"max_score" : 0.30685282,
"hits" : [ {
"_index" : "dc_user_idx",
"_type" : "DC_USER",
"_id" : "1DQlnc2ZQD-QFzbhi3KNpg",
"_score" : 0.30685282, "_source" :
{"userName":"SampleUser","firstName":"SampleUser","lastName":"SampleUser"}
} ]
}
}when i am i have change the text, i.e instead of SampleUser, i have use
NormalUser, its not fetch data.. but record is there in db.On Monday, March 11, 2013 8:09:40 PM UTC+5:30, David Pilato wrote:
Let's do it step by step.
Try this:
SearchResponse response =
client.prepareSearch().setQuery(QueryBuilders.textQuery("firstName",
"SampleUser")).setIndices("dc_user_idx").setTypes("DC_USER").execute().actionGet();If it does not work, can you do:
curl "localhost:9200/dc_user_idx/_search?q=*&pretty"--
David Pilato | Technical Advocate | *Elasticsearch.comhttp://elasticsearch.com/
*
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocsLe 11 mars 2013 à 15:11, srikanth gone srika...@gmail.com a écrit :
Hi David,
i am using mongodb as database. i want to search text using
elasticsearch in java.this is my xml configuration
<elasticsearch:node id="esNode" />
<elasticsearch:client node="esNode" id="esClient" />properties file is:
cluster.name=dc-cluster
name=junit.nodeDisable network
discovery.zen.ping.multicast.enabled=false
node.local=trueUsing less filesystem as possible
index.store.type=memory
index.store.fs.memory.enabled=true
index.gateway.type=none
gateway.type=noneIf ES needs to write something, it's here
path.data=es/twitter
Index are minimalists by default
index.number_of_shards=1
index.number_of_replicas=0using curl i am trying to create indexes
curl -XPUT "http://localhost:9200/_river/dc_role_river/_meta" -d {
"type": "mongodb",
"mongodb": {
"db": "data-collection",
"collection": "DC_USER"
},
"index": {
"name": "dc_user_idx",
"type": "DC_USER"
}
}
this is my java code..Node node = null;
node = NodeBuilder.nodeBuilder().node();Client client = node.client();
SearchResponse response =
client.prepareSearch().setQuery(QueryBuilders.textQuery("firstName",
"SampleUser")).setIndices("_river").setTypes("dc_user_river").execute().actionGet();System.out.println(response);
SearchHit results = response.getHits().getHits();
System.out.println(results);
for (SearchHit hit : results) {
System.out.println(hit.getId()); //prints out the id of the
document
result = hit.getSource(); //the retrieved document
System.out.println(result.keySet());
}out put is:
{
"took" : 281,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" :
}
}i am not able to get the data.
please help me.
--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.