Query_string error

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}
}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}
}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query], total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:
query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in the
error]...

Was there something changed in query_string that I'm missing?

Upon further inspection, that's not the root issue.

The full search looks like this (I've renamed fields/data):

{
"from":0,
"size":"50",
"sort":{"extrasorts.sort_name":"asc"},
"fields":["_id"],
"query":{
"constant_score":{
"filter":{
"and":[
{
"term":{
"node":1
}
},
{
"term":{
"is_searchable":1
}
},
{
"range":{
"somedata.5555.someDateField":{
"from":"2010-12-28T16:12:11-06:00"
}
}
},
{
"term":{
"somedata.1111.somefield":1
}
},
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}
},
{
"terms":{
"tier":[
"1",
"2"
]
}
}
]
},
"boost":1.2
}
}
}

I tried pulling out all of the filters inside of the 'and' except for
the query_string portion and the search worked. So I'm not sure where
the error is. I'm still trying to track it down. But let me know if
you see anything sticking out.

On Dec 28, 4:34 pm, Evan Stenmark stenm...@gmail.com wrote:

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}

}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}

}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query], total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:
query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in the
error]...

Was there something changed in query_string that I'm missing?

From the elasticsearch.log:

[2010-12-28 16:54:02,338][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@a4cc1d]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:
query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@47a2308f^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@26d5587e>]: Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:
173)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
131)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction
$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
76)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException

Even if I take out the 'sort' part:

[2010-12-28 17:01:01,321][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@49033a5]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:
query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@efdb83f7^1.2],from[0],size[50]:
Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:
173)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
131)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction
$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
76)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException

On Dec 28, 4:40 pm, Evan Stenmark stenm...@gmail.com wrote:

Upon further inspection, that's not the root issue.

The full search looks like this (I've renamed fields/data):

{
"from":0,
"size":"50",
"sort":{"extrasorts.sort_name":"asc"},
"fields":["_id"],
"query":{
"constant_score":{
"filter":{
"and":[
{
"term":{
"node":1
}
},
{
"term":{
"is_searchable":1
}
},
{
"range":{
"somedata.5555.someDateField":{
"from":"2010-12-28T16:12:11-06:00"
}
}
},
{
"term":{
"somedata.1111.somefield":1
}
},
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}
},
{
"terms":{
"tier":[
"1",
"2"
]
}
}
]
},
"boost":1.2
}
}

}

I tried pulling out all of the filters inside of the 'and' except for
the query_string portion and the search worked. So I'm not sure where
the error is. I'm still trying to track it down. But let me know if
you see anything sticking out.

On Dec 28, 4:34 pm, Evan Stenmark stenm...@gmail.com wrote:

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}

}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}

}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query], total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:
query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in the
error]...

Was there something changed in query_string that I'm missing?

Can you recreate it with curl? A simple script that creates the index,
initializes it with some data (you can probably do with 2-3 docs), and then
executes the curl request with the search request that causes the error?

As a side note, when it comes to performance, you should execute use a
filtered query, with the query_string as the query, and the rest of the
filters in an and filter.

-shay.banon

On Wed, Dec 29, 2010 at 1:02 AM, Evan Stenmark stenmark@gmail.com wrote:

From the elasticsearch.log:

[2010-12-28 16:54:02,338][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@a4cc1d]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@47a2308f
^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@26d5587e>]: Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:
173)
at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
131)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
76)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException

Even if I take out the 'sort' part:

[2010-12-28 17:01:01,321][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@49033a5]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@efdb83f7
^1.2],from[0],size[50]:
Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:
173)
at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
131)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
76)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException

On Dec 28, 4:40 pm, Evan Stenmark stenm...@gmail.com wrote:

Upon further inspection, that's not the root issue.

The full search looks like this (I've renamed fields/data):

{
"from":0,
"size":"50",
"sort":{"extrasorts.sort_name":"asc"},
"fields":["_id"],
"query":{
"constant_score":{
"filter":{
"and":[
{
"term":{
"node":1
}
},
{
"term":{
"is_searchable":1
}
},
{
"range":{

"somedata.5555.someDateField":{

"from":"2010-12-28T16:12:11-06:00"

                                                    }
                                            }
                                    },
                                    {
                                            "term":{

"somedata.1111.somefield":1

                                            }
                                    },
                                    {
                                            "query":{
                                                    "query_string":{

"fields":[

"somedata.1234.field1",

"somedata.1234.field2"

                                                            ],

"query":"myquery"

                                                    }
                                            }
                                    },
                                    {
                                            "terms":{
                                                    "tier":[
                                                            "1",
                                                            "2"
                                                    ]
                                            }
                                    }
                            ]
                    },
                    "boost":1.2
            }
    }

}

I tried pulling out all of the filters inside of the 'and' except for
the query_string portion and the search worked. So I'm not sure where
the error is. I'm still trying to track it down. But let me know if
you see anything sticking out.

On Dec 28, 4:34 pm, Evan Stenmark stenm...@gmail.com wrote:

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}

}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}

}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query], total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e
^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":

org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in the
error]...

Was there something changed in query_string that I'm missing?

I changed it to be
query
filtered
query
query_string
...
filter
and
...

Upon doing that, I'm not getting anymore errors. I assume that's the
format you suggested for better performance.

Thanks for the help!

On Dec 28, 5:12 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

Can you recreate it with curl? A simple script that creates the index,
initializes it with some data (you can probably do with 2-3 docs), and then
executes the curl request with the search request that causes the error?

As a side note, when it comes to performance, you should execute use a
filtered query, with the query_string as the query, and the rest of the
filters in an and filter.

-shay.banon

On Wed, Dec 29, 2010 at 1:02 AM, Evan Stenmark stenm...@gmail.com wrote:

From the elasticsearch.log:

[2010-12-28 16:54:02,338][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@a4cc1d]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@47a2308f
^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@26d5587e>]: Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:
173)
at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
131)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
76)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException

Even if I take out the 'sort' part:

[2010-12-28 17:01:01,321][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@49033a5]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@efdb83f7
^1.2],from[0],size[50]:
Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:
173)
at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
131)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
76)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException

On Dec 28, 4:40 pm, Evan Stenmark stenm...@gmail.com wrote:

Upon further inspection, that's not the root issue.

The full search looks like this (I've renamed fields/data):

{
"from":0,
"size":"50",
"sort":{"extrasorts.sort_name":"asc"},
"fields":["_id"],
"query":{
"constant_score":{
"filter":{
"and":[
{
"term":{
"node":1
}
},
{
"term":{
"is_searchable":1
}
},
{
"range":{

"somedata.5555.someDateField":{

"from":"2010-12-28T16:12:11-06:00"

                                                    }
                                            }
                                    },
                                    {
                                            "term":{

"somedata.1111.somefield":1

                                            }
                                    },
                                    {
                                            "query":{
                                                    "query_string":{

"fields":[

"somedata.1234.field1",

"somedata.1234.field2"

                                                            ],

"query":"myquery"

                                                    }
                                            }
                                    },
                                    {
                                            "terms":{
                                                    "tier":[
                                                            "1",
                                                            "2"
                                                    ]
                                            }
                                    }
                            ]
                    },
                    "boost":1.2
            }
    }

}

I tried pulling out all of the filters inside of the 'and' except for
the query_string portion and the search worked. So I'm not sure where
the error is. I'm still trying to track it down. But let me know if
you see anything sticking out.

On Dec 28, 4:34 pm, Evan Stenmark stenm...@gmail.com wrote:

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}

}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}

}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query], total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e
^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":

org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in the
error]...

Was there something changed in query_string that I'm missing?

Great that it works, I would still like to check why the previous one did
not work (or at the very least, improve the cryptic error message). Is there
still a chance for a curl recreation?

On Wed, Dec 29, 2010 at 6:37 PM, Evan Stenmark stenmark@gmail.com wrote:

I changed it to be
query
filtered
query
query_string
...
filter
and
...

Upon doing that, I'm not getting anymore errors. I assume that's the
format you suggested for better performance.

Thanks for the help!

On Dec 28, 5:12 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

Can you recreate it with curl? A simple script that creates the index,
initializes it with some data (you can probably do with 2-3 docs), and
then
executes the curl request with the search request that causes the error?

As a side note, when it comes to performance, you should execute use a
filtered query, with the query_string as the query, and the rest of the
filters in an and filter.

-shay.banon

On Wed, Dec 29, 2010 at 1:02 AM, Evan Stenmark stenm...@gmail.com
wrote:

From the elasticsearch.log:

[2010-12-28 16:54:02,338][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@a4cc1d]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@47a2308f

^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@26d5587e>]: Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:

  1. at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:

  1. at

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:

  1. at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NullPointerException

Even if I take out the 'sort' part:

[2010-12-28 17:01:01,321][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@49033a5]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@efdb83f7

^1.2],from[0],size[50]:
Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:

  1. at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:

  1. at

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:

  1. at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NullPointerException

On Dec 28, 4:40 pm, Evan Stenmark stenm...@gmail.com wrote:

Upon further inspection, that's not the root issue.

The full search looks like this (I've renamed fields/data):

{
"from":0,
"size":"50",
"sort":{"extrasorts.sort_name":"asc"},
"fields":["_id"],
"query":{
"constant_score":{
"filter":{
"and":[
{
"term":{
"node":1
}
},
{
"term":{

"is_searchable":1

                                            }
                                    },
                                    {
                                            "range":{

"somedata.5555.someDateField":{

"from":"2010-12-28T16:12:11-06:00"

                                                    }
                                            }
                                    },
                                    {
                                            "term":{

"somedata.1111.somefield":1

                                            }
                                    },
                                    {
                                            "query":{

"query_string":{

"fields":[

"somedata.1234.field1",

"somedata.1234.field2"

                                                            ],

"query":"myquery"

                                                    }
                                            }
                                    },
                                    {
                                            "terms":{
                                                    "tier":[
                                                            "1",
                                                            "2"
                                                    ]
                                            }
                                    }
                            ]
                    },
                    "boost":1.2
            }
    }

}

I tried pulling out all of the filters inside of the 'and' except for
the query_string portion and the search worked. So I'm not sure
where
the error is. I'm still trying to track it down. But let me know if
you see anything sticking out.

On Dec 28, 4:34 pm, Evan Stenmark stenm...@gmail.com wrote:

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}

}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}

}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query],
total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e

^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":

org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in
the
error]...

Was there something changed in query_string that I'm missing?

I'm going to try and get something together.

On Dec 29, 10:57 am, Shay Banon shay.ba...@elasticsearch.com wrote:

Great that it works, I would still like to check why the previous one did
not work (or at the very least, improve the cryptic error message). Is there
still a chance for a curl recreation?

On Wed, Dec 29, 2010 at 6:37 PM, Evan Stenmark stenm...@gmail.com wrote:

I changed it to be
query
filtered
query
query_string
...
filter
and
...

Upon doing that, I'm not getting anymore errors. I assume that's the
format you suggested for better performance.

Thanks for the help!

On Dec 28, 5:12 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

Can you recreate it with curl? A simple script that creates the index,
initializes it with some data (you can probably do with 2-3 docs), and
then
executes the curl request with the search request that causes the error?

As a side note, when it comes to performance, you should execute use a
filtered query, with the query_string as the query, and the rest of the
filters in an and filter.

-shay.banon

On Wed, Dec 29, 2010 at 1:02 AM, Evan Stenmark stenm...@gmail.com
wrote:

From the elasticsearch.log:

[2010-12-28 16:54:02,338][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@a4cc1d]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@47a2308f

^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":
org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@26d5587e>]: Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:

  1. at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:

  1. at

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:

  1. at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NullPointerException

Even if I take out the 'sort' part:

[2010-12-28 17:01:01,321][DEBUG][action.search.type ] [Llan the
Sorcerer] [node226233][0], node[ev3EtX0OQd2vJFNtTj-_Rw], [P],
s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@49033a5]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[node226233][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@efdb83f7

^1.2],from[0],size[50]:
Query Failed [Failed to execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:114)
at

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:

  1. at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:

  1. at

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:

  1. at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction.access$000(TransportSearchTypeAction.java:77)
    at
    org.elasticsearch.action.search.type.TransportSearchTypeAction
    $BaseAsyncAction$1.run(TransportSearchTypeAction.java:150)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor
    $Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NullPointerException

On Dec 28, 4:40 pm, Evan Stenmark stenm...@gmail.com wrote:

Upon further inspection, that's not the root issue.

The full search looks like this (I've renamed fields/data):

{
"from":0,
"size":"50",
"sort":{"extrasorts.sort_name":"asc"},
"fields":["_id"],
"query":{
"constant_score":{
"filter":{
"and":[
{
"term":{
"node":1
}
},
{
"term":{

"is_searchable":1

                                            }
                                    },
                                    {
                                            "range":{

"somedata.5555.someDateField":{

"from":"2010-12-28T16:12:11-06:00"

                                                    }
                                            }
                                    },
                                    {
                                            "term":{

"somedata.1111.somefield":1

                                            }
                                    },
                                    {
                                            "query":{

"query_string":{

"fields":[

"somedata.1234.field1",

"somedata.1234.field2"

                                                            ],

"query":"myquery"

                                                    }
                                            }
                                    },
                                    {
                                            "terms":{
                                                    "tier":[
                                                            "1",
                                                            "2"
                                                    ]
                                            }
                                    }
                            ]
                    },
                    "boost":1.2
            }
    }

}

I tried pulling out all of the filters inside of the 'and' except for
the query_string portion and the search worked. So I'm not sure
where
the error is. I'm still trying to track it down. But let me know if
you see anything sticking out.

On Dec 28, 4:34 pm, Evan Stenmark stenm...@gmail.com wrote:

I recently upgraded to .13 and now I think I'm seeing an issue with
query_string with multiple fields.

If I use this query like:
{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1"
],
"query":"myquery"
}
}

}

I get results and no error, but this query:

{
"query":{
"query_string":{
"fields":[
"somedata.1234.field1",
"somedata.1234.field2"
],
"query":"myquery"
}
}

}

gives me this error (sorry it comes back to me without much
formatting):

SearchPhaseExecutionException[Failed to execute phase [query],
total
failure; shardFailures {[ev3EtX0OQd2vJFNtTj-_Rw][nodedata][0]:
QueryPhaseExecutionException[[nodedata][0]:

query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@744f214e

^1.2],from[0],size[50],sort[<custom:"extrasorts.sort_name":

org.elasticsearch.index.field.data.strings.StringFieldDataType
$1@58e090c8>]: Query Failed [Failed to execute main query]];
nested: }
...[cutting out several more lines of essentially repeated data in
the
error]...

...

read more »