lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gsing...@apache.org
Subject svn commit: r805866 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/util/SolrDocumentModifier.java src/java/org/apache/solr/util/SolrPluginUtils.java src/test/org/apache/solr/util/SolrPluginUtilsTest.java
Date Wed, 19 Aug 2009 16:23:24 GMT
Author: gsingers
Date: Wed Aug 19 16:23:24 2009
New Revision: 805866

URL: http://svn.apache.org/viewvc?rev=805866&view=rev
Log:
SOLR-1367: Reverted, but kept the simple docList test, with modifications

Removed:
    lucene/solr/trunk/src/java/org/apache/solr/util/SolrDocumentModifier.java
Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java
    lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=805866&r1=805865&r2=805866&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Wed Aug 19 16:23:24 2009
@@ -267,11 +267,9 @@
     HTMLStripStandardTokenizerFactory deprecated. To strip HTML tags, HTMLStripCharFilter
can be used
     with an arbitrary Tokenizer. (koji)
 
-68. SOLR-1367: Added callback mechanism for converting DocList to SolrDocumentList in SolrPluginUtils
(gsingers)
+68. SOLR-1275: Add expungeDeletes to DirectUpdateHandler2 (noble)
 
-69. SOLR-1275: Add expungeDeletes to DirectUpdateHandler2 (noble)
-
-70. SOLR-1372: Enhance FieldAnalysisRequestHandler to accept field value from content stream
(ehatcher)
+69. SOLR-1372: Enhance FieldAnalysisRequestHandler to accept field value from content stream
(ehatcher)
 
 
 Optimizations

Modified: lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java?rev=805866&r1=805865&r2=805866&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java Wed Aug 19 16:23:24
2009
@@ -887,16 +887,6 @@
     }
   }
 
-
-  public static SolrDocumentList docListToSolrDocumentList(
-      DocList docs, 
-      SolrIndexSearcher searcher, 
-      Set<String> fields, 
-      Map<SolrDocument, Integer> ids ) throws IOException
-  {
-    return docListToSolrDocumentList(docs, searcher, fields, null, ids);
-  }
-
   /**
    * Convert a DocList to a SolrDocumentList
    *
@@ -906,17 +896,17 @@
    * @param docs The {@link org.apache.solr.search.DocList} to convert
    * @param searcher The {@link org.apache.solr.search.SolrIndexSearcher} to use to load
the docs from the Lucene index
    * @param fields The names of the Fields to load
-   * @param docModifier The {@link SolrDocumentModifier}
    * @param ids A map to store the ids of the docs
    * @return The new {@link org.apache.solr.common.SolrDocumentList} containing all the loaded
docs
    * @throws java.io.IOException if there was a problem loading the docs
    * @since solr 1.4
    */
   public static SolrDocumentList docListToSolrDocumentList(
-      DocList docs,
-      SolrIndexSearcher searcher,
-      Set<String> fields, SolrDocumentModifier docModifier,
-      Map<SolrDocument, Integer> ids ) throws IOException{
+      DocList docs, 
+      SolrIndexSearcher searcher, 
+      Set<String> fields, 
+      Map<SolrDocument, Integer> ids ) throws IOException
+  {
     DocumentBuilder db = new DocumentBuilder(searcher.getSchema());
     SolrDocumentList list = new SolrDocumentList();
     list.setNumFound(docs.matches());
@@ -940,9 +930,6 @@
         doc.addField("score", 0.0f);
       }
 
-      if (docModifier != null) {
-        docModifier.process(doc);
-      }
       list.add( doc );
 
       if( ids != null ) {
@@ -953,6 +940,7 @@
   }
 
 
+
   /**
    * Given a SolrQueryResponse replace the DocList if it is in the result.  
    * Otherwise add it to the response

Modified: lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java?rev=805866&r1=805865&r2=805866&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java (original)
+++ lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java Wed Aug 19 16:23:24
2009
@@ -54,7 +54,7 @@
   public String getSolrConfigFile() { return "solrconfig.xml"; }
 
 
-  public void testDocModifier() throws Exception {
+  public void testDocListConversion() throws Exception {
     assertU("", adoc("id", "3234", "val_t", "quick red fox"));
     assertU("", adoc("id", "3235", "val_t", "quick green fox"));
     assertU("", adoc("id", "3236", "val_t", "quick brown fox"));
@@ -69,16 +69,11 @@
     Set<String> fields = new HashSet<String>();
     fields.add("val_t");
 
-    SolrDocumentModifier docMod = new SolrDocumentModifier() {
-      public void process(SolrDocument doc) {
-        doc.addField("junk", "foo");
-      }
-    };
 
-    SolrDocumentList list = SolrPluginUtils.docListToSolrDocumentList(docs, srchr, fields,
docMod, null);
+    SolrDocumentList list = SolrPluginUtils.docListToSolrDocumentList(docs, srchr, fields,
null);
     assertTrue("list Size: " + list.size() + " is not: " + docs.size(), list.size() == docs.size());
     for (SolrDocument document : list) {
-      assertNotNull(document.get("junk"));
+      assertNotNull(document.get("val_t"));
     }
 
   }



Mime
View raw message