Performing an exact match on a field in a document

Hello Folks,
So I've seen bits and pieces on the mailing list around this topic but have
not seen a satisfactory solution. I have the following document:

{
"documents": [
{
"id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",
"appliance": "appliance2",
"application": "test",
"file":"file1",
"grid":"grid2",
"line":"1",
"sequenceNum":1,
"start_time": 1349514767441,
"thread": "thread1",
"message": "this is test message",
"level": "Info",
"logger": "slogger",
"time": 1349514767441,
"timestamp":"NOW",
"text_all": "this is test message",
"batch_id": "2"
}
]
}

I would like to perform an exact match based on a text string which in this
case would be id, the id represents a guid which has hyphens in it. In
reading some other posts I saw that I need to first create the index with
the following mapping:

curl -XPUT DN7DMPES01001.starwave.com:9200/myns.myset -d '{
"mappings" : {
"elasticsearch" : {
"properties" : {
"id" : { "type": "string", "index" : "not_analyzed" }
}
}
}
}'

I did the above, however when I go to view my mapping I see the following:

{"_index":"myns.myset","_type":"elasticsearch","_id":"_mappings","exists":false}

I'm assuming at this point that my mapping did not take effect, am I missing some steps here, of course as expected when I try to query on the id field I get no match since the field is being tokenized into hyphens and sets of numbers.
I would appreciate some insight , hopefully its something really obvious.

Regards

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

Apologies if part of my message got cut off below, I'm basically unable to
query based on the id because of the index mapping not taking effect

On Wednesday, April 10, 2013 4:26:35 PM UTC-7, Saikat Kanjilal wrote:

Hello Folks,
So I've seen bits and pieces on the mailing list around this topic but
have not seen a satisfactory solution. I have the following document:

{
"documents": [
{
"id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",
"appliance": "appliance2",
"application": "test",
"file":"file1",
"grid":"grid2",
"line":"1",
"sequenceNum":1,
"start_time": 1349514767441,
"thread": "thread1",
"message": "this is test message",
"level": "Info",
"logger": "slogger",
"time": 1349514767441,
"timestamp":"NOW",
"text_all": "this is test message",
"batch_id": "2"
}
]
}

I would like to perform an exact match based on a text string which in
this case would be id, the id represents a guid which has hyphens in it.
In reading some other posts I saw that I need to first create the index
with the following mapping:

curl -XPUT DN7DMPES01001.starwave.com:9200/myns.myset -d '{
"mappings" : {
"elasticsearch" : {
"properties" : {
"id" : { "type": "string", "index" : "not_analyzed" }
}
}
}
}'

I did the above, however when I go to view my mapping I see the following:

{"_index":"myns.myset","_type":"elasticsearch","_id":"_mappings","exists":false}

I'm assuming at this point that my mapping did not take effect, am I missing some steps here, of course as expected when I try to query on the id field I get no match since the field is being tokenized into hyphens and sets of numbers.
I would appreciate some insight , hopefully its something really obvious.

Regards

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

Have a look at this gist. It should help you: Extract domain name and compute size with terms stat facet · GitHub

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

Le 11 avr. 2013 à 01:29, Saikat Kanjilal sxk1969@gmail.com a écrit :

Apologies if part of my message got cut off below, I'm basically unable to query based on the id because of the index mapping not taking effect

On Wednesday, April 10, 2013 4:26:35 PM UTC-7, Saikat Kanjilal wrote:

Hello Folks,
So I've seen bits and pieces on the mailing list around this topic but have not seen a satisfactory solution. I have the following document:

{
"documents": [
{
"id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",
"appliance": "appliance2",
"application": "test",
"file":"file1",
"grid":"grid2",
"line":"1",
"sequenceNum":1,
"start_time": 1349514767441,
"thread": "thread1",
"message": "this is test message",
"level": "Info",
"logger": "slogger",
"time": 1349514767441,
"timestamp":"NOW",
"text_all": "this is test message",
"batch_id": "2"
}
]
}

I would like to perform an exact match based on a text string which in this case would be id, the id represents a guid which has hyphens in it. In reading some other posts I saw that I need to first create the index with the following mapping:

curl -XPUT DN7DMPES01001.starwave.com:9200/myns.myset -d '{
"mappings" : {
"elasticsearch" : {
"properties" : {
"id" : { "type": "string", "index" : "not_analyzed" }
}
}
}
}'

I did the above, however when I go to view my mapping I see the following:

{"_index":"myns.myset","_type":"elasticsearch","_id":"_mappings","exists":false}

I'm assuming at this point that my mapping did not take effect, am I missing some steps here, of course as expected when I try to query on the id field I get no match since the field is being tokenized into hyphens and sets of numbers.
I would appreciate some insight , hopefully its something really obvious.

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