ElasticSearch and Mongo DB

Hi,

I am trying to connect MongoDB to ES via river. My steps:
1.Install mongo.
2. edit /etc/mongodb.conf, add replSet=rs0 record.
3.Install ES
4.Install elasticsearch-river-mongodb driver
5.curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{

"type": "mongodb", 
"mongodb": { 
    "db": "testmongo", 
    "collection": "person"
}, 
"index": {
    "name": "mongoindex", 
    "type": "person" 
}

}'

6.Add some data

use testmongo
var p = {firstName: "John", lastName: "Doe"}
db.person.save(p)

7.Query

curl -XGET 'http://localhost:9200/testmongo/_search?q=firstName:John'

Response:
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

The same true is for pdf files (with attachment plugins). I can't data
indexed at all. What am I missing?

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

Update:
I can get results using
curl -XGET "localhost:9200/_search?q=firstName:John&pretty=true" (without
index)

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

you configured the index to write into as "mongoindex" if you use the above
configuration. So you need to specify that index to query and not the mongo
db name...

On Sat, Apr 13, 2013 at 1:45 PM, Vadim Bartko hudvin@gmail.com wrote:

Hi,

I am trying to connect MongoDB to ES via river. My steps:
1.Install mongo.
2. edit /etc/mongodb.conf, add replSet=rs0 record.
3.Install ES
4.Install elasticsearch-river-mongodb driver
5.curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{

"type": "mongodb",
"mongodb": {
    "db": "testmongo",
    "collection": "person"
},
"index": {
    "name": "mongoindex",
    "type": "person"
}

}'

6.Add some data

use testmongo
var p = {firstName: "John", lastName: "Doe"}
db.person.save(p)

7.Query

curl -XGET 'http://localhost:9200/testmongo/_search?q=firstName:John'

Response:

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":}}

The same true is for pdf files (with attachment plugins). I can't data
indexed at all. What am I missing?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks, it works!
Now I am trying to get highlights to for indexed pdfs.

I use this example:

curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "fs",
"gridfs": true
},
"index": {
"name": "mongoindex",
"type": "files"
}
}'

put to file to mongo:

mongofiles --host localhost:27017 --db testmongo --collection fs --type
applicaton/pdf put ~/Downloads/papers/fulltefffxt.pdf

I am able to get relevant results, but content always returned as base64
string. Should I change somehow mapping to store:yes? I have been playing
with different settings, but without any success.

On Saturday, 13 April 2013 08:00:59 UTC-4, Alexander Reelsen wrote:

Hey,

you configured the index to write into as "mongoindex" if you use the
above configuration. So you need to specify that index to query and not the
mongo db name...

On Sat, Apr 13, 2013 at 1:45 PM, Vadim Bartko <hud...@gmail.com<javascript:>

wrote:

Hi,

I am trying to connect MongoDB to ES via river. My steps:
1.Install mongo.
2. edit /etc/mongodb.conf, add replSet=rs0 record.
3.Install ES
4.Install elasticsearch-river-mongodb driver
5.curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{

"type": "mongodb", 
"mongodb": { 
    "db": "testmongo", 
    "collection": "person"
}, 
"index": {
    "name": "mongoindex", 
    "type": "person" 
}

}'

6.Add some data

use testmongo
var p = {firstName: "John", lastName: "Doe"}
db.person.save(p)

7.Query

curl -XGET 'http://localhost:9200/testmongo/_search?q=firstName:John'

Response:

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":}}

The same true is for pdf files (with attachment plugins). I can't data
indexed at all. What am I missing?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I found correct mappind:

curl -XPUT 'http://localhost:9200/mongoindex/files/_mapping' -d '{
"files": {
"properties": {
"content": {
"path": "full",
"type": "attachment",
"fields": {
"title" : { "store" : "yes" },
"file" : { "term_vector":"with_positions_offsets", "store":"yes" },
"content": {
"type": "string",
"term_vector":"with_positions_offsets", "store":"yes"
},
"author": {
"type": "string"
},
"keywords": {
"type": "string"
},
"name": {
"type": "string"
},
"date": {
"format": "dateOptionalTime",
"type": "date"
},
"content_type": {
"type": "string"
}
},

"chunkSize": {

"type": "long"
},
"md5": {
"type": "string"
},
"length": {
"type": "long"
},
"filename": {
"type": "string"
},
"contentType": {
"type": "string"
},
"uploadDate": {
"format": "dateOptionalTime",
"type": "date"
},
"metadata": {
"dynamic": "true",
"type": "object"
}
}
}
}}'

On Sunday, 14 April 2013 09:16:30 UTC-4, Vadim Bartko wrote:

Thanks, it works!
Now I am trying to get highlights to for indexed pdfs.

I use this example:

curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "fs",
"gridfs": true
},
"index": {
"name": "mongoindex",
"type": "files"
}
}'

put to file to mongo:

mongofiles --host localhost:27017 --db testmongo --collection fs --type
applicaton/pdf put ~/Downloads/papers/fulltefffxt.pdf

I am able to get relevant results, but content always returned as base64
string. Should I change somehow mapping to store:yes? I have been playing
with different settings, but without any success.

On Saturday, 13 April 2013 08:00:59 UTC-4, Alexander Reelsen wrote:

Hey,

you configured the index to write into as "mongoindex" if you use the
above configuration. So you need to specify that index to query and not the
mongo db name...

On Sat, Apr 13, 2013 at 1:45 PM, Vadim Bartko hud...@gmail.com wrote:

Hi,

I am trying to connect MongoDB to ES via river. My steps:
1.Install mongo.
2. edit /etc/mongodb.conf, add replSet=rs0 record.
3.Install ES
4.Install elasticsearch-river-mongodb driver
5.curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{

"type": "mongodb", 
"mongodb": { 
    "db": "testmongo", 
    "collection": "person"
}, 
"index": {
    "name": "mongoindex", 
    "type": "person" 
}

}'

6.Add some data

use testmongo
var p = {firstName: "John", lastName: "Doe"}
db.person.save(p)

7.Query

curl -XGET 'http://localhost:9200/testmongo/_search?q=firstName:John'

Response:

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":}}

The same true is for pdf files (with attachment plugins). I can't data
indexed at all. What am I missing?

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