cpoerschke commented on a change in pull request #1381: SOLR-14364: LTR 
SolrFeature fq improvements
URL: https://github.com/apache/lucene-solr/pull/1381#discussion_r401059139
 
 

 ##########
 File path: 
solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java
 ##########
 @@ -120,67 +123,66 @@ protected void validate() throws FeatureException {
           ": Q or FQ must be provided");
     }
   }
+
   /**
    * Weight for a SolrFeature
    **/
   public class SolrFeatureWeight extends FeatureWeight {
-    final private Weight solrQueryWeight;
-    final private Query query;
-    final private List<Query> queryAndFilters;
+    private final Weight solrQueryWeight;
 
-    public SolrFeatureWeight(IndexSearcher searcher,
-        SolrQueryRequest request, Query originalQuery, Map<String,String[]> 
efi) throws IOException {
+    public SolrFeatureWeight(SolrIndexSearcher searcher,
+                             SolrQueryRequest request, Query originalQuery, 
Map<String, String[]> efi) throws IOException {
       super(SolrFeature.this, searcher, request, originalQuery, efi);
       try {
-        String solrQuery = q;
-        final List<String> fqs = fq;
-
-        if ((solrQuery == null) || solrQuery.isEmpty()) {
-          solrQuery = "*:*";
-        }
-
-        solrQuery = macroExpander.expand(solrQuery);
-        if (solrQuery == null) {
-          throw new FeatureException(this.getClass().getSimpleName()+" 
requires efi parameter that was not passed in request.");
-        }
-
-        final SolrQueryRequest req = makeRequest(request.getCore(), solrQuery,
-            fqs, df);
+        final SolrQueryRequest req = makeRequest(request.getCore(), q, fq, df);
         if (req == null) {
           throw new IOException("ERROR: No parameters provided");
         }
 
+        // Build the scoring query
+        Query scoreQuery;
+        String qStr = q;
 
 Review comment:
   observation: i like how use of `qStr` here hints towards String type which 
is clearer to read than the prior `solrQuery` being String type but namewise 
hinting towards Query type

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to