Elasticsearch-0.19.4 _all search query throws an exception


(Praveen Kariyanahalli) #1

We have our documents indexed everyday (tenant name and date based) and the
mapping are tenant based.

For example:
Index : abcDotcom-2012-09-18
Type/Mapping: abcDotCom-documentTypeBlah

So we get the corresponding tenant documents search result by manipulating
the index name and Type in our search query.

But sometimes when we need to get all the documents for a give tenant
(independent of date), we query like

http://localhost:9200/_all/abcDotCom-documentTypeBlah/_search ..

But note that for another tenant xyzDotCom there wont be any mapping
called abcDotCom-documentTypeBlah. Hence I expect it to skip over. Instead
I see an exception thrown by the error logs.

How can change my query so that elasticsearch doesnt throw this exception?

Thanks in Advance
-pk

[2012-09-18 19:59:44,760][DEBUG][action.search.type ] [Patriot I]
[xyzDotcom-2012-09-13][0], node[G7TdDyODQ-SEr_K76lfJUw], [P], s[STARTED]:
Failed to execute [org.elasticsearch.action.search.SearchRequest@2c06bf4f]
org.elasticsearch.search.SearchParseException: [xyzDotCom-2012-09-13][0]:query[ConstantScore(NotDeleted(:*))]
*,from[-1],size[-1]: Parse Failure [Failed to parse source
[{"query":{"match_all":{}},"sort":{"created_timestamp":{"order":"desc","ignore_unmapped":"true"}},"facets":{"user":{"terms":{"field":"user"}},"facility":{"terms":{"field":"facility"}},"severity":{"terms":{"field":"severity"}},"histo1":{"date_histogram":{"field":"created_timestamp","interval":"minute"}}}}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.elasticsearch.search.facet.FacetPhaseExecutionException:
Facet [histo1]: (key) field [created_timestamp] not found
at
org.elasticsearch.search.facet.datehistogram.DateHistogramFacetProcessor.parse(DateHistogramFacetProcessor.java:147)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:93)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:545)
... 10 more

--


(Praveen Kariyanahalli) #2

Clarification: I am happy with the result. It is just that the ES throws
this exception and fills up my error log file/directory. I need a way to
suppress this exception error being thrown (or ignored).

--


(Praveen Kariyanahalli) #3

Any Idea what I am doing wrong here ?

Thanks in Advance
-pk

--


(system) #4