QueryParsingException exception thrown only for empty index

Hi,
I notice this exception only when index is empty, i.e. there is no data for an index. Query is embedded in the exception stack trace.

16:42:19.148 [elasticsearch[local_jvm_node][search][T#1]] DEBUG org.elasticsearch.action.count - [local_jvm_node] [testindex_10][4], node[1], [P], s[STARTED]: Failed to execute [[[testalias_10]][], querySource[{"constant_score":{"filter":{"and":{"filters":[{"term":{"tenantId":"10"}},{"numeric_range":{"fromTime":{"from":1342072320000,"to":null,"include_lower":true,"include_upper":true}}},{"numeric_range":{"toTime":{"from":null,"to":1342072320000,"include_lower":true,"include_upper":true}}},{"terms":{"cspId":[]}}]}}}}]]
org.elasticsearch.index.query.QueryParsingException: [testindex_10] failed to find mapping for field [fromTime]
at org.elasticsearch.index.query.NumericRangeFilterParser.parse(NumericRangeFilterParser.java:115) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.AndFilterParser.parse(AndFilterParser.java:72) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.ConstantScoreQueryParser.parse(ConstantScoreQueryParser.java:66) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:199) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.shard.service.InternalIndexShard.count(InternalIndexShard.java:409) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:134) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:50) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:234) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:211) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:187) [elasticsearch-0.19.6.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_33]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_33]

Any idea why this would happen? As soon as I put some data in index, and run the same query, I do not see this exception.
In index mapping, "fromTime" is mapped to "date".

Thanks
Ashish

Did you create the index ?
Or is the index created when you put your first document ?

If you created the index, did you set the mapping ?

David

--

Le 13 juil. 2012 à 01:53, Ashish Nigam nigamashish@gmail.com a écrit :

Hi,
I notice this exception only when index is empty, i.e. there is no data for an index. Query is embedded in the exception stack trace.

16:42:19.148 [elasticsearch[local_jvm_node][search][T#1]] DEBUG org.elasticsearch.action.count - [local_jvm_node] [testindex_10][4], node[1], [P], s[STARTED]: Failed to execute [[[testalias_10]], querySource[{"constant_score":{"filter":{"and":{"filters":[{"term":{"tenantId":"10"}},{"numeric_range":{"fromTime":{"from":1342072320000,"to":null,"include_lower":true,"include_upper":true}}},{"numeric_range":{"toTime":{"from":null,"to":1342072320000,"include_lower":true,"include_upper":true}}},{"terms":{"cspId":}}]}}}}]]
org.elasticsearch.index.query.QueryParsingException: [testindex_10] failed to find mapping for field [fromTime]
at org.elasticsearch.index.query.NumericRangeFilterParser.parse(NumericRangeFilterParser.java:115) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.AndFilterParser.parse(AndFilterParser.java:72) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.ConstantScoreQueryParser.parse(ConstantScoreQueryParser.java:66) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:199) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.shard.service.InternalIndexShard.count(InternalIndexShard.java:409) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:134) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:50) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:234) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:211) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:187) [elasticsearch-0.19.6.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_33]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_33]

Any idea why this would happen? As soon as I put some data in index, and run the same query, I do not see this exception.
In index mapping, "fromTime" is mapped to "date".

Thanks
Ashish

Yes, Index is already created and I also set the mapping. Here's index mapping -

{
state: open
settings: {
index.analysis.analyzer.comma.type: pattern
index.analysis.analyzer.comma.pattern: (^\s+)|(\s*),(\s*)|(\s+$)
index.number_of_shards: 5
index.number_of_replicas: 1
index.version.created: 190399
}
mappings: {
eventsummarydata: {
_source: {
compress: true
}
dynamic_templates: [
{
store_generic: {
mapping: {
index: not_analyzed
}
match: *
}
}
]
properties: {
tenantId: {
type: integer
}
count: {
type: integer
}
uniqueUsers: {
analyzer: comma
type: string
}
userIdentifier: {
type: integer
}
locationId: {
type: integer
}
uniqueUsersCount: {
type: integer
}
cspId: {
type: integer
}
id: {
type: integer
}
totime: {
format: dateOptionalTime
type: date
}
uploadId: {
type: integer
}
fromtime: {
format: dateOptionalTime
type: date
}
group2: {
analyzer: comma
type: string
}
deviceId: {
type: integer
}
}
}
}
aliases: [
testalias_10
]
}

Thanks
Ashish

On Jul 12, 2012, at 5:20 PM, David Pilato wrote:

Did you create the index ?
Or is the index created when you put your first document ?

If you created the index, did you set the mapping ?

David

--

Le 13 juil. 2012 à 01:53, Ashish Nigam nigamashish@gmail.com a écrit :

Hi,
I notice this exception only when index is empty, i.e. there is no data for an index. Query is embedded in the exception stack trace.

16:42:19.148 [elasticsearch[local_jvm_node][search][T#1]] DEBUG org.elasticsearch.action.count - [local_jvm_node] [testindex_10][4], node[1], [P], s[STARTED]: Failed to execute [[[testalias_10]], querySource[{"constant_score":{"filter":{"and":{"filters":[{"term":{"tenantId":"10"}},{"numeric_range":{"fromTime":{"from":1342072320000,"to":null,"include_lower":true,"include_upper":true}}},{"numeric_range":{"toTime":{"from":null,"to":1342072320000,"include_lower":true,"include_upper":true}}},{"terms":{"cspId":}}]}}}}]]
org.elasticsearch.index.query.QueryParsingException: [testindex_10] failed to find mapping for field [fromTime]
at org.elasticsearch.index.query.NumericRangeFilterParser.parse(NumericRangeFilterParser.java:115) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.AndFilterParser.parse(AndFilterParser.java:72) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.ConstantScoreQueryParser.parse(ConstantScoreQueryParser.java:66) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:199) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.shard.service.InternalIndexShard.count(InternalIndexShard.java:409) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:134) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:50) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:234) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:211) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:187) [elasticsearch-0.19.6.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_33]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_33]

Any idea why this would happen? As soon as I put some data in index, and run the same query, I do not see this exception.
In index mapping, "fromTime" is mapped to "date".

Thanks
Ashish

In your mapping you have fromtime but you ask for fromTime.
It could be your problem.

David

--

Le 13 juil. 2012 à 03:23, Ashish Nigam nigamashish@gmail.com a écrit :

Yes, Index is already created and I also set the mapping. Here's index mapping -

{
state: open
settings: {
index.analysis.analyzer.comma.type: pattern
index.analysis.analyzer.comma.pattern: (^\s+)|(\s*),(\s*)|(\s+$)
index.number_of_shards: 5
index.number_of_replicas: 1
index.version.created: 190399
}
mappings: {
eventsummarydata: {
_source: {
compress: true
}
dynamic_templates: [
{
store_generic: {
mapping: {
index: not_analyzed
}
match: *
}
}
]
properties: {
tenantId: {
type: integer
}
count: {
type: integer
}
uniqueUsers: {
analyzer: comma
type: string
}
userIdentifier: {
type: integer
}
locationId: {
type: integer
}
uniqueUsersCount: {
type: integer
}
cspId: {
type: integer
}
id: {
type: integer
}
totime: {
format: dateOptionalTime
type: date
}
uploadId: {
type: integer
}
fromtime: {
format: dateOptionalTime
type: date
}
group2: {
analyzer: comma
type: string
}
deviceId: {
type: integer
}
}
}
}
aliases: [
testalias_10
]
}

Thanks
Ashish

On Jul 12, 2012, at 5:20 PM, David Pilato wrote:

Did you create the index ?
Or is the index created when you put your first document ?

If you created the index, did you set the mapping ?

David

--

Le 13 juil. 2012 à 01:53, Ashish Nigam nigamashish@gmail.com a écrit :

Hi,
I notice this exception only when index is empty, i.e. there is no data for an index. Query is embedded in the exception stack trace.

16:42:19.148 [elasticsearch[local_jvm_node][search][T#1]] DEBUG org.elasticsearch.action.count - [local_jvm_node] [testindex_10][4], node[1], [P], s[STARTED]: Failed to execute [[[testalias_10]], querySource[{"constant_score":{"filter":{"and":{"filters":[{"term":{"tenantId":"10"}},{"numeric_range":{"fromTime":{"from":1342072320000,"to":null,"include_lower":true,"include_upper":true}}},{"numeric_range":{"toTime":{"from":null,"to":1342072320000,"include_lower":true,"include_upper":true}}},{"terms":{"cspId":}}]}}}}]]
org.elasticsearch.index.query.QueryParsingException: [testindex_10] failed to find mapping for field [fromTime]
at org.elasticsearch.index.query.NumericRangeFilterParser.parse(NumericRangeFilterParser.java:115) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.AndFilterParser.parse(AndFilterParser.java:72) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:223) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.ConstantScoreQueryParser.parse(ConstantScoreQueryParser.java:66) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:199) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.index.shard.service.InternalIndexShard.count(InternalIndexShard.java:409) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:134) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:50) ~[elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:234) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:211) [elasticsearch-0.19.6.jar:na]
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:187) [elasticsearch-0.19.6.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_33]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_33]

Any idea why this would happen? As soon as I put some data in index, and run the same query, I do not see this exception.
In index mapping, "fromTime" is mapped to "date".

Thanks
Ashish