You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use SearchSourceBuilder.parseXContent to validate the incoming queries and have put guardrails preventing
customers from running expensive queries.
Running below query throws ParsingException[unknown query [knn] error from SearchSourceBuilder.fromXContent
ParsingException[unknown query [knn]
]; nested: NamedObjectNotFoundException[[4:5] unknown field [knn]];
at __randomizedtesting.SeedInfo.seed([56E084C5B196F75:A6CF98EA22D26BD0]:0)
at org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder(AbstractQueryBuilder.java:341)
at org.opensearch.search.builder.SearchSourceBuilder.parseXContent(SearchSourceBuilder.java:1183)
at org.opensearch.search.builder.SearchSourceBuilder.fromXContent(SearchSourceBuilder.java:140)
at org.opensearch.search.builder.SearchSourceBuilder.fromXContent(SearchSourceBuilder.java:135)
at org.opensearch.search.builder.SearchSourceBuilderTests.testKnnParsing(SearchSourceBuilderTests.java:359)
What solution would you like?
This is happening because OpenSearch project doesn't have a KnnQueryBuilder class.
Once created, has to get referenced in SearchModule.registerQueryParsers method as
registerQuery(new QuerySpec<>(KnnQueryBuilder.NAME, KnnQueryBuilder::new, KnnQueryBuilder::fromXContent));
What alternatives have you considered?
We rely heavily on these validations and changing the implemention would require our team go through the entire suite of performance and fmea tests.
Do you have any additional context?
I have the code ready and open to contribute as soon as this request is approved.
The text was updated successfully, but these errors were encountered:
This is happening because OpenSearch project doesn't have a KnnQueryBuilder class.
So the KNN query is part of K-NN plugin. This is the reason why it is not part of OpenSearch core repo. You need to install the k-NN plugin so that query type is registered.
I am not able to understand what is required here. Can you please add more details what are the expectations here? because as per my understanding Plugins need to register SearchPlugin interfaces to register the query types they are providing.
Is your feature request related to a problem?
We use SearchSourceBuilder.parseXContent to validate the incoming queries and have put guardrails preventing
customers from running expensive queries.
Running below query throws ParsingException[unknown query [knn] error from SearchSourceBuilder.fromXContent
Dependency: opensearch-2.6.0
Pom:
Error stack trace
What solution would you like?
This is happening because OpenSearch project doesn't have a KnnQueryBuilder class.
Once created, has to get referenced in SearchModule.registerQueryParsers method as
registerQuery(new QuerySpec<>(KnnQueryBuilder.NAME, KnnQueryBuilder::new, KnnQueryBuilder::fromXContent));
What alternatives have you considered?
We rely heavily on these validations and changing the implemention would require our team go through the entire suite of performance and fmea tests.
Do you have any additional context?
I have the code ready and open to contribute as soon as this request is approved.
The text was updated successfully, but these errors were encountered: