-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Search Detector result to SDK using SDKRestClient #377
Comments
This is blocked as currently the result index is not created while creating the detector.
Will be covered in #626 |
@owaiskazi19 The anomaly result index is created as part of the |
This is currently failing with the below error: 17:31:19.108 [httpclient-dispatch-1] ERROR org.opensearch.ad.transport.SearchAnomalyResultTransportAction - Failed to search result indices for all detectors
java.lang.ClassCastException: class org.opensearch.search.aggregations.bucket.terms.ParsedStringTerms cannot be cast to class org.opensearch.search.aggregations.bucket.terms.StringTerms (org.opensearch.search.aggregations.bucket.terms.ParsedStringTerms and org.opensearch.search.aggregations.bucket.terms.StringTerms are in unnamed module of loader 'app')
at org.opensearch.ad.transport.SearchAnomalyResultTransportAction.processSingleSearchResponse(SearchAnomalyResultTransportAction.java:136) ~[main/:?]
at org.opensearch.ad.transport.SearchAnomalyResultTransportAction.lambda$searchADResultIndex$3(SearchAnomalyResultTransportAction.java:240) ~[main/:?]
at org.opensearch.action.ActionListener$1.onResponse(ActionListener.java:80) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
at org.opensearch.client.RestHighLevelClient$1.onSuccess(RestHighLevelClient.java:2093) [opensearch-rest-high-level-client-3.0.0-SNAPSHOT.jar:?]
at org.opensearch.client.RestClient$FailureTrackingResponseListener.onSuccess(RestClient.java:721) [opensearch-rest-client-3.0.0-SNAPSHOT.jar:?]
at org.opensearch.client.RestClient$1.completed(RestClient.java:440) [opensearch-rest-client-3.0.0-SNAPSHOT.jar:?]
at org.opensearch.client.RestClient$1.completed(RestClient.java:434) [opensearch-rest-client-3.0.0-SNAPSHOT.jar:?]
at org.apache.hc.core5.concurrent.BasicFuture.completed(BasicFuture.java:123) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.concurrent.ComplexFuture.completed(ComplexFuture.java:79) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient$1$3$1.completed(InternalAbstractHttpAsyncClient.java:299) [httpclient5-5.1.4.jar:5.1.4]
at org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer$2.completed(AbstractAsyncResponseConsumer.java:108) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityConsumer.completed(AbstractBinAsyncEntityConsumer.java:84) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.nio.entity.AbstractBinDataConsumer.streamEnd(AbstractBinDataConsumer.java:81) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer.streamEnd(AbstractAsyncResponseConsumer.java:149) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.streamEnd(HttpAsyncMainClientExec.java:235) [httpclient5-5.1.4.jar:5.1.4]
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamHandler.dataEnd(ClientHttp1StreamHandler.java:280) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer.dataEnd(ClientHttp1StreamDuplexer.java:366) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onInput(AbstractHttp1StreamDuplexer.java:335) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.inputReady(AbstractHttp1IOEventHandler.java:64) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.inputReady(ClientHttp1IOEventHandler.java:41) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:133) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85) [httpcore5-5.1.5.jar:5.1.5]
at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44) [httpcore5-5.1.5.jar:5.1.5]
at java.lang.Thread.run(Thread.java:832) [?:?] |
Solved the above error by changing the return type to |
Query:
Response:
|
API: /_anomaly_detection/detectors/results/_search Query:
Response:
|
API: 127.0.0.1:9200/_extensions/_ad-extension/detectors/results/_search/opensearch-ad-plugin-result-test1?only_query_custom_result_index=true Query:
Response:
|
API: 127.0.0.1:9200/_extensions/_ad-extension/detectors/results/_search/opensearch-ad-plugin-result-test1?only_query_custom_result_index=false Query:
Response:
|
Is your feature request related to a problem?
Part of opensearch-project/OpenSearch#5224
What solution would you like?
Migrate the Search Detector result Rest API to Extensions SDK using SDKRestClient.
Use the implementation of #353 as a reference. Add new issues for any steps you skip.
Implement the following API endpoints:
POST _plugins/_anomaly_detection/detectors/results/_search/
POST _plugins/_anomaly_detection/detectors/results/_search/<custom_result_index>
POST _plugins/_anomaly_detection/detectors/results/_search/<custom_result_index>?only_query_custom_result_index=false
POST _plugins/_anomaly_detection/detectors/results/_search/<custom_result_index>?only_query_custom_result_index=true
The text was updated successfully, but these errors were encountered: