ElasticSearch 0.90 fails when "highlight" contains a field of type "long"

Hi!

We are migrating from ES 0.20.6 to 0.90 and we found the following problem:
If the "highlight" section of a searh query contains a field of type
"long", an error occurs. That didn't happen with the old version.
This is a sample script I used to test this behaviour:

curl -s -o /dev/null -X DELETE "http://${hostname}:9200/test?pretty"

curl -s -o /dev/null -X PUT "http://${hostname}:9200/test/?pretty" -d '
{
"mappings" : {
"test1" : {
"properties" : {
"text" : {
"store": "yes",
"type": "string"
}
}
},
"test2" : {
"properties" : {
"text" : {
"store": "yes",
"type": "string"
},
"number" : {
"store": "yes",
"type": "long"
}
}
}
}
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test/test1?pretty" -d
'
{
"text" : "test one"
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test/test2?pretty" -d
'
{
"text" : "test two",
"number" : 100
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test1/_refresh"
curl -s -o /dev/null -X POST "http://${hostname}:9200/test2/_refresh"

sleep 3

curl -s -X GET "http://${hostname}:9200/test/_search?pretty" -d '
{
"query": {
"prefix": {
"text": "test"
}
},
"highlight": {
"number_of_fragments": 0,
"fields": {
"text": {},
"number": {}
}
}

}'

If you run it against an elasticsearch 0.20.6 server, it returns the two
hits, correctly highlighted.
However, if you run it against an elasticsearch 0.90 server, this happens:

{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 4,
"failed" : 1,
"failures" : [ {
"index" : "test",
"shard" : 0,
"status" : 500,
"reason" : "FetchPhaseExecutionException[[test][0]:
query[text:test*],from[0],size[10]: Fetch Failed [Failed to highlight field
[number]]]; nested: StringIndexOutOfBoundsException[String index out of
range: -1]; "
} ]
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "test1",
"_id" : "y51XzuuaQ6uYnigzhq5EtA",
"_score" : 1.0, "_source" :
{
"text" : "test one"
}
,
"highlight" : {
"text" : [ "test one" ]
}
} ]
}
}

Can anybody tell me why this happens? Thanks in advance!

Guillermo Arias del Río.

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

can you open an issue for this?

simon

On Wednesday, June 19, 2013 4:59:32 PM UTC+2, Guillermo Arias del Río wrote:

Hi!

We are migrating from ES 0.20.6 to 0.90 and we found the following
problem: If the "highlight" section of a searh query contains a field of
type "long", an error occurs. That didn't happen with the old version.
This is a sample script I used to test this behaviour:

curl -s -o /dev/null -X DELETE "http://${hostname}:9200/test?pretty"

curl -s -o /dev/null -X PUT "http://${hostname}:9200/test/?pretty" -d '
{
"mappings" : {
"test1" : {
"properties" : {
"text" : {
"store": "yes",
"type": "string"
}
}
},
"test2" : {
"properties" : {
"text" : {
"store": "yes",
"type": "string"
},
"number" : {
"store": "yes",
"type": "long"
}
}
}
}
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test/test1?pretty"
-d '
{
"text" : "test one"
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test/test2?pretty"
-d '
{
"text" : "test two",
"number" : 100
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test1/_refresh"
curl -s -o /dev/null -X POST "http://${hostname}:9200/test2/_refresh"

sleep 3

curl -s -X GET "http://${hostname}:9200/test/_search?pretty" -d '
{
"query": {
"prefix": {
"text": "test"
}
},
"highlight": {
"number_of_fragments": 0,
"fields": {
"text": {},
"number": {}
}
}

}'

If you run it against an elasticsearch 0.20.6 server, it returns the two
hits, correctly highlighted.
However, if you run it against an elasticsearch 0.90 server, this happens:

{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 4,
"failed" : 1,
"failures" : [ {
"index" : "test",
"shard" : 0,
"status" : 500,
"reason" : "FetchPhaseExecutionException[[test][0]:
query[text:test*],from[0],size[10]: Fetch Failed [Failed to highlight field
[number]]]; nested: StringIndexOutOfBoundsException[String index out of
range: -1]; "
} ]
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "test1",
"_id" : "y51XzuuaQ6uYnigzhq5EtA",
"_score" : 1.0, "_source" :
{
"text" : "test one"
}
,
"highlight" : {
"text" : [ "test one" ]
}
} ]
}
}

Can anybody tell me why this happens? Thanks in advance!

Guillermo Arias del Río.

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

OK, done

On Thursday, June 20, 2013 9:56:58 AM UTC+2, simonw wrote:

can you open an issue for this?

simon

On Wednesday, June 19, 2013 4:59:32 PM UTC+2, Guillermo Arias del Río
wrote:

Hi!

We are migrating from ES 0.20.6 to 0.90 and we found the following
problem: If the "highlight" section of a searh query contains a field of
type "long", an error occurs. That didn't happen with the old version.
This is a sample script I used to test this behaviour:

curl -s -o /dev/null -X DELETE "http://${hostname}:9200/test?pretty"

curl -s -o /dev/null -X PUT "http://${hostname}:9200/test/?pretty" -d '
{
"mappings" : {
"test1" : {
"properties" : {
"text" : {
"store": "yes",
"type": "string"
}
}
},
"test2" : {
"properties" : {
"text" : {
"store": "yes",
"type": "string"
},
"number" : {
"store": "yes",
"type": "long"
}
}
}
}
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test/test1?pretty"
-d '
{
"text" : "test one"
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test/test2?pretty"
-d '
{
"text" : "test two",
"number" : 100
}
'

curl -s -o /dev/null -X POST "http://${hostname}:9200/test1/_refresh"
curl -s -o /dev/null -X POST "http://${hostname}:9200/test2/_refresh"

sleep 3

curl -s -X GET "http://${hostname}:9200/test/_search?pretty" -d '
{
"query": {
"prefix": {
"text": "test"
}
},
"highlight": {
"number_of_fragments": 0,
"fields": {
"text": {},
"number": {}
}
}

}'

If you run it against an elasticsearch 0.20.6 server, it returns the two
hits, correctly highlighted.
However, if you run it against an elasticsearch 0.90 server, this happens:

{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 4,
"failed" : 1,
"failures" : [ {
"index" : "test",
"shard" : 0,
"status" : 500,
"reason" : "FetchPhaseExecutionException[[test][0]:
query[text:test*],from[0],size[10]: Fetch Failed [Failed to highlight field
[number]]]; nested: StringIndexOutOfBoundsException[String index out of
range: -1]; "
} ]
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "test1",
"_id" : "y51XzuuaQ6uYnigzhq5EtA",
"_score" : 1.0, "_source" :
{
"text" : "test one"
}
,
"highlight" : {
"text" : [ "test one" ]
}
} ]
}
}

Can anybody tell me why this happens? Thanks in advance!

Guillermo Arias del Río.

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