It is possibile don't token word with elasticsearch?


(Fedele Mantuano) #1

Hi,

i have a question. I have an elasticsearch server and I use logstash to put
log into it, but I noticed that the mail are tokenized:

test@example-test.com became [test, example, test].

It is possibile don't token word with elasticsearch?

I found this guide:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.htmlbut
I can't work.

Is this code correct?

curl -XPUT http://localhost:9200/test_index/ -d '
{

"settings": {
"analysis" : {
"filter" : {
"word_filter" : {
"type":"word_delimiter",
"generate_word_parts":"false",
"generate_number_parts":"false",
"split_on_numerics":"false",
"split_on_case_change":"false",
"preserve_original":"true"
}}}}}'

Thanks

--
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/d1550294-777b-40f6-9f70-3531ddf9a7cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

Change the mapping for this field and change index to not_analyzed.
So it will be kept as is.

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

Le 31 juil. 2014 à 21:55, Fedele Mantuano mantuano.fedele@gmail.com a écrit :

Hi,

i have a question. I have an elasticsearch server and I use logstash to put log into it, but I noticed that the mail are tokenized:

test@example-test.com became [test, example, test].

It is possibile don't token word with elasticsearch?

I found this guide:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html

but I can't work.

Is this code correct?

curl -XPUT http://localhost:9200/test_index/ -d '
{
"settings": {
"analysis" : {
"filter" : {
"word_filter" : {
"type":"word_delimiter",
"generate_word_parts":"false",
"generate_number_parts":"false",
"split_on_numerics":"false",
"split_on_case_change":"false",
"preserve_original":"true"
}}}}}'

Thanks

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/d1550294-777b-40f6-9f70-3531ddf9a7cc%40googlegroups.com.
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/3567C7B1-7BF3-4739-85B5-03FE29306FF2%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(Fedele Mantuano) #3

Thanks.

I do like this:

curl -XPUT http://localhost:9200/index_test/ -d '
{
"mappings": {
"type_test1" : {
"properties" : {
"sender-address" : {
"type" : "string",
"index": "not_analyzed" },
"recipient-address" : {
"type" : "string",
"index": "not_analyzed" }}},
"type_test2" : {
"properties" : {
"User-Agent" : {
"type" : "string",
"index": "not_analyzed" }}}}}'

and I solved.

Bye bye

On Thursday, July 31, 2014 9:55:42 PM UTC+2, Fedele Mantuano wrote:

Hi,

i have a question. I have an elasticsearch server and I use logstash to
put log into it, but I noticed that the mail are tokenized:

test@example-test.com became [test, example, test].

It is possibile don't token word with elasticsearch?

I found this guide:

*http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html*but
I can't work.

Is this code correct?

curl -XPUT http://localhost:9200/test_index/ -d '
{

"settings": {
"analysis" : {
"filter" : {
"word_filter" : {
"type":"word_delimiter",
"generate_word_parts":"false",
"generate_number_parts":"false",
"split_on_numerics":"false",
"split_on_case_change":"false",
"preserve_original":"true"
}}}}}'

Thanks

--
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/9fa76939-84ec-41c4-a47f-a0b3543a77a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4