lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r639430 - in /lucene/solr/trunk/src: java/org/apache/solr/handler/admin/LukeRequestHandler.java webapp/resources/admin/schema.jsp
Date Thu, 20 Mar 2008 19:56:18 GMT
Author: ehatcher
Date: Thu Mar 20 12:56:17 2008
New Revision: 639430

URL: http://svn.apache.org/viewvc?rev=639430&view=rev
Log:
Fix LukeRequestHandler and schema browser to work properly with multicore (patch supplied
by Greg Ludington)

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
    lucene/solr/trunk/src/webapp/resources/admin/schema.jsp

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java?rev=639430&r1=639429&r2=639430&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java Thu Mar
20 12:56:17 2008
@@ -301,7 +301,7 @@
 
       f.add( "type", (ftype==null)?null:ftype.getTypeName() );
       f.add( "schema", getFieldFlags( sfield ) );
-      if (schema.getDynamicPattern(sfield.getName()) != null) {
+      if (sfield != null && schema.getDynamicPattern(sfield.getName()) != null) {
     	  f.add("dynamicBase", schema.getDynamicPattern(sfield.getName()));
       }
 

Modified: lucene/solr/trunk/src/webapp/resources/admin/schema.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/schema.jsp?rev=639430&r1=639429&r2=639430&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/schema.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/schema.jsp Thu Mar 20 12:56:17 2008
@@ -125,13 +125,17 @@
             //Attach this field to its dynamicField
             var base = field.dynamicBase;
             var dynField = solr.schemaDynamicFields[base];
-            var synFields = dynField['fields'];
-            
-            if (synFields== undefined) {
-              synFields= new Array();
+
+            //Some fields in a multicore setting have no dynamic base, either
+            // the name of the core is a field that has no type or flags
+            if (dynField != undefined) {
+            	var synFields = dynField['fields'];
+	            if (synFields== undefined) {
+    	          synFields= new Array();
+        	    }
+            	synFields.push(i);
+            	dynField['fields'] = synFields;
             }
-            synFields.push(i);
-            dynField['fields'] = synFields;
             solr.schemaFields[i] = item;
           }
           //Populate other data in this field that would not have been loaded in
@@ -326,6 +330,8 @@
       var ft;
       var ftName;
       $('#mainInfo').html('');  
+      $('#topTerms').html('');
+      $('#histogram').html('');
       $('#mainInfo').append(solr.createSimpleText('Field: ' + fieldName));
       
       //For regular fields, we take their properties; for dynamicFields,
@@ -377,7 +383,7 @@
       if (field.topTerms != undefined) {
         solr.displayTopTerms(field.topTerms, fieldName);
       }
-      $('#histogram').html('');
+
       if (field.histogram != undefined) {
         solr.drawHistogram(field.histogram);
       }



Mime
View raw message