Add settings and mapping when create new _river mongodb

Hi everybody!

I want to add settings and mappings when I create new _river mongodb
following that:

curl -XPUT 'localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"servers": [
{"host": "Konoha", "port": 27018},
{"host": "Konoha", "port": 27027}
],
"db": "testmongo",
"collection": "person",
"options": {
"secondary_read_preference": true,
"drop_collection": true
},
"gridfs": false
},
"index": {
"name": "person",
"type": "person"
},
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
"filter": ["standard", "my_delimiter", "lowercase",
"stop", "asciifolding", "porter_stem"]
},
"search_analyzer": {
"tokenizer": "standard",
"filter": ["standard", "lowercase", "stop",
"asciifolding", "porter_stem"]
}
},
"filter": {
"my_delimiter": {
"type": "word_delimiter",
"generate_word_parts": true,
"catenate_words": true,
"catenate_numbers": true,
"catenate_all": true,
"split_on_case_change": true,
"preserve_original": true,
"split_on_numerics": true,
"stem_english_possessive": true
}
}
}
}
}'

When I run: http://localhost:9200/person/_settings on my browser, results
are:

{"person":{"settings":{"index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

It seem my settings above was not applied :frowning:

Can you help me the way to add settings or mapping when initiate mongodb river

Thank you for helping me :slight_smile:

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

Create index person with it's settings and mapping for peron type before creating the river.

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/
http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/

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

Le 4 août 2013 à 10:58, manhnv@gsm.vn a écrit :

Hi everybody!

I want to add settings and mappings when I create new _river mongodb following that:

curl -XPUT 'localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"servers": [
{"host": "Konoha", "port": 27018},
{"host": "Konoha", "port": 27027}
],
"db": "testmongo",
"collection": "person",
"options": {
"secondary_read_preference": true,
"drop_collection": true
},
"gridfs": false
},
"index": {
"name": "person",
"type": "person"
},
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
"filter": ["standard", "my_delimiter", "lowercase", "stop", "asciifolding", "porter_stem"]
},
"search_analyzer": {
"tokenizer": "standard",
"filter": ["standard", "lowercase", "stop", "asciifolding", "porter_stem"]
}
},
"filter": {
"my_delimiter": {
"type": "word_delimiter",
"generate_word_parts": true,
"catenate_words": true,
"catenate_numbers": true,
"catenate_all": true,
"split_on_case_change": true,
"preserve_original": true,
"split_on_numerics": true,
"stem_english_possessive": true
}
}
}
}
}'

When I run: http://localhost:9200/person/_settings on my browser, results are:
{"person":{"settings":{"index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

It seem my settings above was not applied :frowning:

Can you help me the way to add settings or mapping when initiate mongodb river

Thank you for helping me :slight_smile:

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

Thank you very much, David Pilato :smiley:

I did it :stuck_out_tongue:

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

Hi, I have a record following:

"sony vaio is best laptop"

When I search: "so" or "be" or "lap". It returns result

But when I search "top" or "aio" or "ony". It does not return any result

I think the ES will search from beginning of the word

Can you tell me, how can I search anywhere of the word (make filter?)

Thank you very much

On Monday, August 5, 2013 10:29:37 PM UTC+7, man...@gsm.vn wrote:

Thank you very much, David Pilato :smiley:

I did it :stuck_out_tongue:

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

check out the ngram tokenizer, it does what you need. However be aware,
that this results in a bigger index and may result in a result explosion...

--Alex

On Tue, Aug 6, 2013 at 9:46 AM, manhnv@gsm.vn wrote:

Hi, I have a record following:

"sony vaio is best laptop"

When I search: "so" or "be" or "lap". It returns result

But when I search "top" or "aio" or "ony". It does not return any result

I think the ES will search from beginning of the word

Can you tell me, how can I search anywhere of the word (make filter?)

Thank you very much

On Monday, August 5, 2013 10:29:37 PM UTC+7, man...@gsm.vn wrote:

Thank you very much, David Pilato :smiley:

I did it :stuck_out_tongue:

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

Hi, thanks for your reply. I know using NGram tokenizer will get the
results :smiley:

On Wednesday, August 7, 2013 1:39:54 PM UTC+7, Alexander Reelsen wrote:

Hey,

check out the ngram tokenizer, it does what you need. However be aware,
that this results in a bigger index and may result in a result explosion...

--Alex

On Tue, Aug 6, 2013 at 9:46 AM, <man...@gsm.vn <javascript:>> wrote:

Hi, I have a record following:

"sony vaio is best laptop"

When I search: "so" or "be" or "lap". It returns result

But when I search "top" or "aio" or "ony". It does not return any result

I think the ES will search from beginning of the word

Can you tell me, how can I search anywhere of the word (make filter?)

Thank you very much

On Monday, August 5, 2013 10:29:37 PM UTC+7, man...@gsm.vn wrote:

Thank you very much, David Pilato :smiley:

I did it :stuck_out_tongue:

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