Accessing tokens of an inner field


(Pierre De Soyres) #1

Hi,

I'm trying to access generated token on a inner field .

Assuming the following mapping :

{
"myMapping" : {
"properties" : {
"simple_field" : {"type" : "string", "store" : "yes"},
"complex_object" : {
"properties" : {
"inner_field" : {"type" : "string", "store" : "yes"}
}
}
}
}
}

curl 'http://localhost:9200/test_index/myMapping/_search?pretty=true' -d '{
"query" : {
"match" : {
"_id" : 24
}
},
"script_fields": {
"terms" : {
"script": "doc[field].values",
"params": {
* "field": "simple_field"*
}
}
}
}'

when asking tokens of field "simple_field", all is going fine. But when I
ask for "complex_object.inner_field", I get the following error :
RuntimeException[unable to invoke method]; nested:
InvocationTargetException; nested: ArrayIndexOutOfBoundsException[10];

Is there any way (excluding analyze API) to get the tokens generated for an
object inner field of a single document ? (I'm using elasticsearch 0.90.0.)

Thanks for helping

Pierre.

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


(Luca Cavanna) #2

Hi Pierre,
do you have the whole stacktrace of that error? I would be curious to know
more about it.

What you are trying to do is not possible with 0.90 but will be possible in
1.0 storing term_vectors and using the term_vectors api
(http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html).

On Wednesday, October 16, 2013 11:54:25 AM UTC+2, Pierre de Soyres wrote:

Hi,

I'm trying to access generated token on a inner field .

Assuming the following mapping :

{
"myMapping" : {
"properties" : {
"simple_field" : {"type" : "string", "store" : "yes"},
"complex_object" : {
"properties" : {
"inner_field" : {"type" : "string", "store" : "yes"}
}
}
}
}
}

curl 'http://localhost:9200/test_index/myMapping/_search?pretty=true' -d
'{
"query" : {
"match" : {
"_id" : 24
}
},
"script_fields": {
"terms" : {
"script": "doc[field].values",
"params": {
* "field": "simple_field"*
}
}
}
}'

when asking tokens of field "simple_field", all is going fine. But when I
ask for "complex_object.inner_field", I get the following error :
RuntimeException[unable to invoke method]; nested:
InvocationTargetException; nested: ArrayIndexOutOfBoundsException[10];

Is there any way (excluding analyze API) to get the tokens generated for
an object inner field of a single document ? (I'm using elasticsearch
0.90.0.)

Thanks for helping

Pierre.

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


(Luca Cavanna) #3

Sorry, to clarify what I previously wrote, I'm not aware of any other way
to do what you are trying to do with 0.90, but if you provide the
stacktrace we can look into the problem with inner objects and see what we
can do to fix that.

On Thursday, October 17, 2013 3:31:30 PM UTC+2, Luca Cavanna wrote:

Hi Pierre,
do you have the whole stacktrace of that error? I would be curious to know
more about it.

What you are trying to do is not possible with 0.90 but will be possible
in 1.0 storing term_vectors and using the term_vectors api (
http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html
).

On Wednesday, October 16, 2013 11:54:25 AM UTC+2, Pierre de Soyres wrote:

Hi,

I'm trying to access generated token on a inner field .

Assuming the following mapping :

{
"myMapping" : {
"properties" : {
"simple_field" : {"type" : "string", "store" : "yes"},
"complex_object" : {
"properties" : {
"inner_field" : {"type" : "string", "store" : "yes"}
}
}
}
}
}

curl 'http://localhost:9200/test_index/myMapping/_search?pretty=true' -d
'{
"query" : {
"match" : {
"_id" : 24
}
},
"script_fields": {
"terms" : {
"script": "doc[field].values",
"params": {
* "field": "simple_field"*
}
}
}
}'

when asking tokens of field "simple_field", all is going fine. But when I
ask for "complex_object.inner_field", I get the following error :
RuntimeException[unable to invoke method]; nested:
InvocationTargetException; nested: ArrayIndexOutOfBoundsException[10];

Is there any way (excluding analyze API) to get the tokens generated for
an object inner field of a single document ? (I'm using elasticsearch
0.90.0.)

Thanks for helping

Pierre.

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


(system) #4