lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1157692 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReturnFields.java
Date Mon, 15 Aug 2011 01:02:18 GMT
Author: ryan
Date: Mon Aug 15 01:02:18 2011
New Revision: 1157692

URL: http://svn.apache.org/viewvc?rev=1157692&view=rev
Log:
SOLR-2657:  adding some more comments and caching glob calculations

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReturnFields.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReturnFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReturnFields.java?rev=1157692&r1=1157691&r2=1157692&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReturnFields.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReturnFields.java Mon Aug 15
01:02:18 2011
@@ -53,9 +53,15 @@ public class ReturnFields
   public static final String SCORE = "score";
 
   private final List<String> globs = new ArrayList<String>(1);
-  private final Set<String> fields = new LinkedHashSet<String>(); // order is
important for CSVResponseWriter
-  private Set<String> okFieldNames = new HashSet<String>(); // Collection of
everything that could match
-
+  
+  // The lucene field names to request from the SolrIndexSearcher
+  // Order is important for CSVResponseWriter
+  private final Set<String> fields = new LinkedHashSet<String>();
+  
+  // Field names that are OK to include in the response.
+  // This will include pseudo fields, lucene fields, and matching globs
+  private Set<String> okFieldNames = new HashSet<String>(); 
+  
   private DocTransformer transformer;
   private boolean _wantsScore = false;
   private boolean _wantsAllFields = false;
@@ -360,6 +366,7 @@ public class ReturnFields
     for( String s : globs ) {
       // TODO something better?
       if( FilenameUtils.wildcardMatch( name, s ) ) {
+        okFieldNames.add(name); // Don't calculate it again
         return true;
       }
     }



Mime
View raw message