Can't access stringValue in sort with 0.90

Getting this after doing an upgrade and re-indexing, no query changes.

  • error: SearchPhaseExecutionException[Failed to execute phase
    [query_fetch], total failure; shardFailures
    {[6D6tfWXdQpy7R4okCHRERw][agency][0]:
    QueryPhaseExecutionException[[agency][0]:
    query[name:m*],from[0],size[10],sort[<custom:"_script":
    org.elasticsearch.index.fielddata.fieldcomparator.DoubleScriptDataComparator$InnerSource@2a16b4b1>!]:
    Query Failed [Failed to execute main query]]; nested:
    PropertyAccessException[[Error: could not access: stringValue; in class:
    org.elasticsearch.index.fielddata.ScriptDocValues$Strings] [Near : {... 10
    / doc['name.sort'].stringValue.l ....}] ^ [Line: 1, Column: 6]]; }]
  • status: 500

{
"query": {
"query_string": {
"query": "m*",
"default_field": "name",
"default_operator": "AND"
}
},
"fields": [
"agencyOffices",
"name",
"_id"
],
"sort": [
{
"_script": {
"order": "desc",
"type": "number",
"script": "10 / doc['name.sort'].stringValue.length() + doc.score"
}
}
],
"track_scores": false
}

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

Change the "stringValue" to "value" will work.

On Tuesday, April 30, 2013 2:47:47 AM UTC+8, Darius Riggins wrote:

Getting this after doing an upgrade and re-indexing, no query changes.

  • error: SearchPhaseExecutionException[Failed to execute phase
    [query_fetch], total failure; shardFailures
    {[6D6tfWXdQpy7R4okCHRERw][agency][0]:
    QueryPhaseExecutionException[[agency][0]:
    query[name:m*],from[0],size[10],sort[<custom:"_script":
    org.elasticsearch.index.fielddata.fieldcomparator.DoubleScriptDataComparator$InnerSource@2a16b4b1>!]:
    Query Failed [Failed to execute main query]]; nested:
    PropertyAccessException[[Error: could not access: stringValue; in class:
    org.elasticsearch.index.fielddata.ScriptDocValues$Strings] [Near : {... 10
    / doc['name.sort'].stringValue.l ....}] ^ [Line: 1, Column: 6]]; }]
  • status: 500

{
"query": {
"query_string": {
"query": "m*",
"default_field": "name",
"default_operator": "AND"
}
},
"fields": [
"agencyOffices",
"name",
"_id"
],
"sort": [
{
"_script": {
"order": "desc",
"type": "number",
"script": "10 / doc['name.sort'].stringValue.length() + doc.score"
}
}
],
"track_scores": false
}

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

With the field data refactoring the string|double|longValue version were
removed so value should work just fine here.

simon

On Sunday, May 5, 2013 2:45:12 AM UTC+2, Alger Hoi wrote:

Change the "stringValue" to "value" will work.

On Tuesday, April 30, 2013 2:47:47 AM UTC+8, Darius Riggins wrote:

Getting this after doing an upgrade and re-indexing, no query changes.

  • error: SearchPhaseExecutionException[Failed to execute phase
    [query_fetch], total failure; shardFailures
    {[6D6tfWXdQpy7R4okCHRERw][agency][0]:
    QueryPhaseExecutionException[[agency][0]:
    query[name:m*],from[0],size[10],sort[<custom:"_script":
    org.elasticsearch.index.fielddata.fieldcomparator.DoubleScriptDataComparator$InnerSource@2a16b4b1>!]:
    Query Failed [Failed to execute main query]]; nested:
    PropertyAccessException[[Error: could not access: stringValue; in class:
    org.elasticsearch.index.fielddata.ScriptDocValues$Strings] [Near : {... 10
    / doc['name.sort'].stringValue.l ....}] ^ [Line: 1, Column: 6]]; }]
  • status: 500

{
"query": {
"query_string": {
"query": "m*",
"default_field": "name",
"default_operator": "AND"
}
},
"fields": [
"agencyOffices",
"name",
"_id"
],
"sort": [
{
"_script": {
"order": "desc",
"type": "number",
"script": "10 / doc['name.sort'].stringValue.length() + doc.score"
}
}
],
"track_scores": false
}

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