alessandrobenedetti commented on PR #1245:
URL: https://github.com/apache/solr/pull/1245#issuecomment-1361107904

   > I'm looking closer at KnnQParser; ...
   
   David, your help has been invaluable!
   You are absolutely right and this is an oversight of mine when I did the 
original review of the pre-filtering work(this naming is quite common in the 
neural search community).
   
   I think that I have found the perfect place for this fix and it literally 
would require few lines of code, rather than the complicate methods that are in 
place now:
   
   org.apache.solr.search.QueryUtils#combineQueryAndFilter
   `
   ...
   } else if(scoreQuery instanceof KnnVectorQuery){
           (KnnVectorQuery)scoreQuery.setFilter(filterQuery);
         }
         else {
           return new BooleanQuery.Builder()
               .add(scoreQuery, Occur.MUST)
               .add(filterQuery, Occur.FILTER)
               .build();
         }
   `
   Basically when we combine the query with the filter, we manage the thing 
differently for KNN queries, and the filter(excluding post filters) is set in 
the Lucene KnnVectorQuery.
   
   So far so good, elegant and minimal code change, filters are processed ones 
, everyone is happy...
   BUT
   currently KnnVectorQuery in Lucene has no getters and setters and has all 
variable as final!!
   This is extremely annoying but we are where we are (to be honest, for a 
library class I would have gone with private variables with getters/setters 
since the beginning).
   
   Also, now Lucene is a separate project, so I basically should do the change 
in Lucene, then wait for a Lucene release, include it in Solr ect ect 
   
   So, long story short, my suggestion:
   1) we proceed with the current hack, renaming where necessary to make it 
nicer, but no massive change
   2) contribute the change Lucene side, probably removing final, and adding 
getters/setters or if the community disagree, just adding getters so that It's 
possible to create a new class from the input one
   3) once Lucene releases and we have the code in Solr, do the nice and clean 
implementation
   
   let me know what do you think!


-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to