What am I missing about the river-mongodb?


(lsx) #1

Hi, I am new in ES.
I do a test as the river-mongodb example:

[in terminal]
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "person"
},
"index": {
"name": "mongoindex",
"type": "person"
}
}'

[in mongodb]
use testmongo
var p = {'firstName': "John", 'lastName': "Doe"}
db.person.save(p);

[in terminal]
curl -XGET "http://localhost:9200/testmongo/_search?q=firstName:John"

And I get the error:
{"error":"IndexMissingException[[testmongo] missing]","status":404}

So what am I missing or something I make it wrong? How can I pass my
first test?
My environment:
Debian version: 6/64bit
OpenJDK version:1.6.0_18 64bit
ES version: 0.19.1
river-mongodb version: 1.1.0
mongodb version: 2.0.2

Thank you for help. :slight_smile:


(Roly Vicaria) #2

You called the index "mongoindex" up above....i think you're curl command
just needs to change the index name from "testmongo" to "mongoindex".
disclaimer, i haven't used this, I'm just guessing.

On Monday, March 26, 2012 4:54:53 AM UTC-4, lsx wrote:

Hi, I am new in ES.
I do a test as the river-mongodb example:

[in terminal]
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "person"
},
"index": {
"name": "mongoindex",
"type": "person"
}
}'

[in mongodb]
use testmongo
var p = {'firstName': "John", 'lastName': "Doe"}
db.person.save(p);

[in terminal]
curl -XGET "http://localhost:9200/testmongo/_search?q=firstName:John"

And I get the error:
{"error":"IndexMissingException[[testmongo] missing]","status":404}

So what am I missing or something I make it wrong? How can I pass my
first test?
My environment:
Debian version: 6/64bit
OpenJDK version:1.6.0_18 64bit
ES version: 0.19.1
river-mongodb version: 1.1.0
mongodb version: 2.0.2

Thank you for help. :slight_smile:


(lsx) #3

Thank you for your help.
I test the "mongoindex" and I get these:
{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
I think these maybe some states but not what I want.
I see the docs of ES about the index and get, it show the data like :
{
"_index" : "twitter",
"_type" : "tweet",
"_id" : "1",
"_source" : {
"user" : "kimchy",
"postDate" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}
}
So I must make something wrong, I will read the docs and try. :slight_smile:

Thanks. :slight_smile:
在 2012年3月27日 下午10:01,Roly Vicaria rolyv19@gmail.com 写道:

You called the index "mongoindex" up above....i think you're curl command
just needs to change the index name from "testmongo" to "mongoindex".
disclaimer, i haven't used this, I'm just guessing.

On Monday, March 26, 2012 4:54:53 AM UTC-4, lsx wrote:

Hi, I am new in ES.
I do a test as the river-mongodb example:

[in terminal]
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "person"
},
"index": {
"name": "mongoindex",
"type": "person"
}
}'

[in mongodb]
use testmongo
var p = {'firstName': "John", 'lastName': "Doe"}
db.person.save(p);

[in terminal]
curl -XGET "http://localhost:9200/testmongo/_search?q=firstName:John"

And I get the error:
{"error":"IndexMissingException[[testmongo] missing]","status":404}

So what am I missing or something I make it wrong? How can I pass my
first test?
My environment:
Debian version: 6/64bit
OpenJDK version:1.6.0_18 64bit
ES version: 0.19.1
river-mongodb version: 1.1.0
mongodb version: 2.0.2

Thank you for help. :slight_smile:


(system) #4