eliaporciani commented on code in PR #904:
URL: https://github.com/apache/solr/pull/904#discussion_r923375406
##########
solr/core/src/java/org/apache/solr/search/neural/KnnQParser.java:
##########
@@ -72,7 +78,41 @@ public Query parse() {
DenseVectorField denseVectorType = (DenseVectorField) fieldType;
float[] parsedVectorToSearch = parseVector(vectorToSearch,
denseVectorType.getDimension());
- return denseVectorType.getKnnVectorQuery(schemaField.getName(),
parsedVectorToSearch, topK);
+
+ return denseVectorType.getKnnVectorQuery(
+ schemaField.getName(), parsedVectorToSearch, topK, getFilterQuery());
+ }
+
+ private Query getFilterQuery() throws SolrException {
+ if (!isFilter()) {
+ String[] filterQueries = req.getParams().getParams(CommonParams.FQ);
+ if (filterQueries != null && filterQueries.length != 0) {
+ return computeFilterQuery(filterQueries);
+ }
+ }
+ return null;
+ }
+
+ private Query computeFilterQuery(String[] filterQueries) throws
SolrException {
Review Comment:
changed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]