Newbie question about count (No query parser registered for [query])


(Itai Frenkel) #1

Hello,

I've got a search query that returns results, but when I try to
perform a count using the same search query I get an exception.

Itai

index
'oknesset'

type
'committees'

search_query
'{"query": {"field": {"topics": "\u05e7\u05e8\u05d
u05d5\u05e9\u05dc\u05d9\u05e9\u05d9\u05ea"}}}'

conn.search(indexes={index},doc_types={type},query=search_query)
...
...
5d4\u05dc\u05d4 \u05d1\u05e9\u05e2\u05d4 12:45'}], 'id': 1732,
'committee': 5, 'date_string': u'\u05
db' \u05d0\u05d9\u05d9\u05e8 \u05ea\u05e9"\u05e2, (04/05/2010)'},
'_index': 'oknesset'}], 'total':
3, 'max_score': 1.7088871}, '_shards': {'successful': 5, 'failed': 0,
'total': 5}}

conn.count(indexes={index},doc_types={type},query=search_query)
{'count': 0, '_shards': {'successful': 0, 'failed': 5, 'total': 5,
'failures': [{'index': 'oknesset'
, 'reason': 'BroadcastShardOperationFailedException[[oknesset][2] ];
nested: QueryParsingException[[
oknesset] No query parser registered for [query]]; ', 'shard': 2},
{'index': 'oknesset', 'reason': '
BroadcastShardOperationFailedException[[oknesset][0] ]; nested:
QueryParsingException[[oknesset] No
query parser registered for [query]]; ', 'shard': 0}, {'index':
'oknesset', 'reason': 'BroadcastShar
dOperationFailedException[[oknesset][3] ]; nested:
QueryParsingException[[oknesset] No query parser
registered for [query]]; ', 'shard': 3}, {'index': 'oknesset',
'reason': 'BroadcastShardOperationFai
ledException[[oknesset][4] ]; nested: QueryParsingException[[oknesset]
No query parser registered fo
r [query]]; ', 'shard': 4}, {'index': 'oknesset', 'reason':
'BroadcastShardOperationFailedException[
[oknesset][1] ]; nested: QueryParsingException[[oknesset] No query
parser registered for [query]]; '
, 'shard': 1}]}}

[2010-11-23 20:40:28,968][DEBUG][action.count ] [Orchid]
[oknesset][1], node[3-C3z5ieQe6
MX4M2WoZpRg], [P], s[STARTED]: Failed to execute [[[oknesset]]
[committees], querySource[{"query": {"
field": {"topics": "\u05e7\u05e8\u05d9\u05d0\u05d4
\u05e9\u05e0\u05d9\u05d4 \u05d5\u05e9\u05dc\u05d9
\u05e9\u05d9\u05ea"}}}]]
org.elasticsearch.index.query.QueryParsingException: [oknesset] No
query parser registered for [query]
at
org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:
142)
at
org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:
23)
at
org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:
18)
at
org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:
17)
at
org.elasticsearch.index.shard.service.InternalIndexShard.count(InternalIndexShard.java:
357)
at
org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:
116)
at
org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:
48)
at
org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction
$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:
238)
at
org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction
$AsyncBroadcastAction.access
$200(TransportBroadcastOperationAction.java:126)
at
org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction
$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:
195)
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)


(Shay Banon) #2

Hey,

Can you get the actual query that gets built and executed for it (the
"curl" one)?

-shay.banon

On Tue, Nov 23, 2010 at 8:41 PM, Itai Frenkel itaifrenkel@live.com wrote:

Hello,

I've got a search query that returns results, but when I try to
perform a count using the same search query I get an exception.

Itai

index
'oknesset'

type
'committees'

search_query
'{"query": {"field": {"topics": "\u05e7\u05e8\u05d
u05d5\u05e9\u05dc\u05d9\u05e9\u05d9\u05ea"}}}'

conn.search(indexes={index},doc_types={type},query=search_query)
...
...
5d4\u05dc\u05d4 \u05d1\u05e9\u05e2\u05d4 12:45'}], 'id': 1732,
'committee': 5, 'date_string': u'\u05
db' \u05d0\u05d9\u05d9\u05e8 \u05ea\u05e9"\u05e2, (04/05/2010)'},
'_index': 'oknesset'}], 'total':
3, 'max_score': 1.7088871}, '_shards': {'successful': 5, 'failed': 0,
'total': 5}}

conn.count(indexes={index},doc_types={type},query=search_query)
{'count': 0, '_shards': {'successful': 0, 'failed': 5, 'total': 5,
'failures': [{'index': 'oknesset'
, 'reason': 'BroadcastShardOperationFailedException[[oknesset][2] ];
nested: QueryParsingException[[
oknesset] No query parser registered for [query]]; ', 'shard': 2},
{'index': 'oknesset', 'reason': '
BroadcastShardOperationFailedException[[oknesset][0] ]; nested:
QueryParsingException[[oknesset] No
query parser registered for [query]]; ', 'shard': 0}, {'index':
'oknesset', 'reason': 'BroadcastShar
dOperationFailedException[[oknesset][3] ]; nested:
QueryParsingException[[oknesset] No query parser
registered for [query]]; ', 'shard': 3}, {'index': 'oknesset',
'reason': 'BroadcastShardOperationFai
ledException[[oknesset][4] ]; nested: QueryParsingException[[oknesset]
No query parser registered fo
r [query]]; ', 'shard': 4}, {'index': 'oknesset', 'reason':
'BroadcastShardOperationFailedException[
[oknesset][1] ]; nested: QueryParsingException[[oknesset] No query
parser registered for [query]]; '
, 'shard': 1}]}}

[2010-11-23 20:40:28,968][DEBUG][action.count ] [Orchid]
[oknesset][1], node[3-C3z5ieQe6
MX4M2WoZpRg], [P], s[STARTED]: Failed to execute [[[oknesset]]
[committees], querySource[{"query": {"
field": {"topics": "\u05e7\u05e8\u05d9\u05d0\u05d4
\u05e9\u05e0\u05d9\u05d4 \u05d5\u05e9\u05dc\u05d9
\u05e9\u05d9\u05ea"}}}]]
org.elasticsearch.index.query.QueryParsingException: [oknesset] No
query parser registered for [query]
at

org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:
142)
at

org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:
23)
at

org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:
18)
at

org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:
17)
at

org.elasticsearch.index.shard.service.InternalIndexShard.count(InternalIndexShard.java:
357)
at

org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:
116)
at

org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:
48)
at

org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction

$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:
238)
at

org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction
$AsyncBroadcastAction.access
$200(TransportBroadcastOperationAction.java:126)
at

org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction
$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:
195)
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)


(system) #3