lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steff...@apache.org
Subject svn commit: r1438901 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/webapp/ solr/webapp/web/css/styles/ solr/webapp/web/js/ solr/webapp/web/js/lib/ solr/webapp/web/js/scripts/ solr/webapp/web/tpl/
Date Sat, 26 Jan 2013 15:02:43 GMT
Author: steffkes
Date: Sat Jan 26 15:02:42 2013
New Revision: 1438901

URL: http://svn.apache.org/viewvc?rev=1438901&view=rev
Log:
SOLR-4225: Term info page under schema browser shows incorrect count of terms (merge r1438900)

Removed:
    lucene/dev/branches/branch_4x/solr/webapp/web/js/lib/jquery.sparkline.js
Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/web/css/styles/schema-browser.css
    lucene/dev/branches/branch_4x/solr/webapp/web/js/main.js
    lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/app.js
    lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/dataimport.js
    lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/schema-browser.js
    lucene/dev/branches/branch_4x/solr/webapp/web/tpl/schema-browser.html

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Sat Jan 26 15:02:42 2013
@@ -65,6 +65,9 @@ Bug Fixes
   next record the same as a problem parsing the record - log the exception and
   break. (Mark Miller)
 
+* SOLR-4225: Term info page under schema browser shows incorrect count of terms
+  (steffkes)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/css/styles/schema-browser.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/css/styles/schema-browser.css?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/css/styles/schema-browser.css (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/css/styles/schema-browser.css Sat Jan 26
15:02:42 2013
@@ -390,7 +390,8 @@
   color: #333;
 }
 
-#content #schema-browser #data #field .topterms-holder
+#content #schema-browser #data #field .topterms-holder,
+#content #schema-browser #data #field .histogram-holder
 {
   border-left: 1px solid #f0f0f0;
   display: none;
@@ -448,12 +449,12 @@
   margin-bottom: 5px;
 }
 
+/* possible overwrite with inline style */
 #content #schema-browser .topterms-holder li p
 {
   background-color:  #999;
   color: #fff;
   float: left;
-  width: 25px;
 }
 
 #content #schema-browser .topterms-holder li p span
@@ -463,6 +464,7 @@
   text-align: right;
 }
 
+/* possible overwrite with inline style */
 #content #schema-browser .topterms-holder li ul
 {
   margin-left: 30px;
@@ -492,51 +494,65 @@
   background-color: #c0c0c0;
 }
 
-#content #schema-browser #data #field .histogram-holder
+#content #schema-browser #data #field .histogram-holder ul
 {
-  border-left: 1px solid #f0f0f0;
-  display: none;
-  float: left;
-  padding-left: 20px;
-  padding-right: 20px;
+  margin-left: 25px;
+}
+
+#content #schema-browser #data #field .histogram-holder li
+{
+  margin-bottom: 2px;
+  position: relative;
+  width: 150px;
 }
 
-#content #schema-browser #data #field .histogram-holder .histogram
+#content #schema-browser #data #field .histogram-holder li.odd
 {
-  height: 150px;
+  background-color: #f0f0f0;
 }
 
-#content #schema-browser #data #field .histogram-holder .histogram.single canvas
+#content #schema-browser #data #field .histogram-holder li dl,
+#content #schema-browser #data #field .histogram-holder li dt
+{
+  padding-top: 1px;
+  padding-bottom: 1px;
+}
+
+#content #schema-browser #data #field .histogram-holder li dl
 {
   background-color: #c0c0c0;
+  min-width: 1px;
 }
 
-#content #schema-browser #data #field .histogram-holder dt,
-#content #schema-browser #data #field .histogram-holder dd
+#content #schema-browser #data #field .histogram-holder li dt
 {
-  float: left;
-  font-size: 10px;
-  text-align: center;
+  color: #a0a0a0;
+  position: absolute;
+  overflow: hidden;
+  left: -25px;
+  top: 0px;
 }
 
-#content #schema-browser #data #field .histogram-holder span
+#content #schema-browser #data #field .histogram-holder li dt span
 {
-  background-color: #f0f0f0;
   display: block;
-  width: 20px;
+  padding-right: 4px;
+  text-align: right;
 }
 
-#content #schema-browser #data #field .histogram-holder dt
+#content #schema-browser #data #field .histogram-holder li dd
 {
-  padding-right: 1px;
+  clear: left;
+  float: left;
+  margin-left: 2px;
 }
 
-#content #schema-browser #data #field .histogram-holder dd
+#content #schema-browser #data #field .histogram-holder li:hover dl
 {
-  padding-right: 3px;
+  background-color: #b0b0b0;
 }
 
-#content #schema-browser #data #field .histogram-holder dd span
+#content #schema-browser #data #field .histogram-holder li:hover dt
 {
-  width: 25px;
-}
+  color: #333;
+}
\ No newline at end of file

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/js/main.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/js/main.js?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/js/main.js (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/js/main.js Sat Jan 26 15:02:42 2013
@@ -25,7 +25,6 @@ require
     'lib/order!lib/jquery.form',
     'lib/order!lib/jquery.jstree',
     'lib/order!lib/jquery.sammy',
-    'lib/order!lib/jquery.sparkline',
     'lib/order!lib/jquery.timeago',
     'lib/order!lib/jquery.blockUI',
     'lib/order!lib/highlight',

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/app.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/app.js?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/app.js (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/app.js Sat Jan 26 15:02:42 2013
@@ -468,6 +468,11 @@ var solr_admin = function( app_config )
     return json_str;
   };
 
+  this.format_number = function format_number( number )
+  {
+    return ( number || 0 ).toString().replace( /\B(?=(\d{3})+(?!\d))/g, ' ' );
+  };
+
 };
 
 var app = new solr_admin( app_config );

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/dataimport.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/dataimport.js?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/dataimport.js (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/dataimport.js Sat Jan 26 15:02:42
2013
@@ -440,11 +440,6 @@ sammy.get
                 var messages_count = 0;
                 for( var key in messages ) { messages_count++; }
 
-                var format_number = function format_number( number )
-                {
-                  return ( number || 0 ).toString().replace( /\B(?=(\d{3})+(?!\d))/g, '\''
);
-                };
-
                 function dataimport_compute_details( response, details_element, elapsed_seconds
)
                 {
                   details_element
@@ -464,10 +459,10 @@ sammy.get
                   {
                     var value = parseInt( response.statusMessages[document_config[key]],
10 );
 
-                    var detail = '<abbr title="' + document_config[key].esc() + '">'
+ key.esc() + '</abbr>: ' +  format_number( value ).esc();
+                    var detail = '<abbr title="' + document_config[key].esc() + '">'
+ key.esc() + '</abbr>: ' +  app.format_number( value ).esc();
                     if( elapsed_seconds && 'skipped' !== key.toLowerCase() )
                     {
-                      detail += ' <span>(' + format_number( Math.round( value / elapsed_seconds
) ).esc() + '/s)</span>'
+                      detail += ' <span>(' + app.format_number( Math.round( value /
elapsed_seconds ) ).esc() + '/s)</span>'
                     }
 
                     document_details.push( detail );
@@ -523,7 +518,7 @@ sammy.get
                     /\d{4,}/g,
                     function( match, position, string )
                     {
-                      return format_number( parseInt( match, 10 ) );
+                      return app.format_number( parseInt( match, 10 ) );
                     }
                   );
 

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/schema-browser.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/schema-browser.js?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/schema-browser.js (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/schema-browser.js Sat Jan 26
15:02:42 2013
@@ -66,9 +66,7 @@ var load_terminfo = function( trigger_el
       },
       success : function( response, text_status, xhr )
       {
-        $( 'span', trigger_element )
-          .removeClass( 'loader' );
-
+        var additional_styles = [];
         var field_data = response.fields[field];
 
         if( !field_data || !( field_data.topTerms && field_data.histogram ) )
@@ -79,6 +77,11 @@ var load_terminfo = function( trigger_el
           return false;
         }
 
+        var get_width = function get_width()
+        {
+          return $( this ).width();
+        }
+
         var topterms_holder_element = $( '.topterms-holder', data_element );
         var histogram_holder_element = $( '.histogram-holder', data_element );
 
@@ -111,7 +114,7 @@ var load_terminfo = function( trigger_el
 
               topterms_frq_last = topterms[i+1];
               topterms_content += '<li class="clearfix">'
-                               +  '<p><span>' + topterms_frq_last.esc() + '</span></p>'
+ "\n"
+                               +  '<p><span>' + app.format_number( topterms_frq_last
) + '</span></p>' + "\n"
                                +  '<ul>' + "\n";
             }
 
@@ -129,6 +132,13 @@ var load_terminfo = function( trigger_el
           topterms_table_element
             .html( topterms_content );
 
+          var max_width = 10 + Math.max.apply( Math, $( 'p', topterms_table_element ).map(
get_width ).get() );
+          additional_styles.push
+          (
+            topterms_table_element.selector + ' p { width: ' + max_width + 'px !important;
}' + "\n" +
+            topterms_table_element.selector + ' ul { margin-left: ' + ( max_width + 5 ) +
'px !important; }'
+          );
+
           topterms_count_element
             .val( topterms_count );
 
@@ -152,52 +162,57 @@ var load_terminfo = function( trigger_el
           histogram_holder_element
             .show();
 
-          var histogram_element = $( '.histogram', histogram_holder_element );
-
           var histogram_values = luke_array_to_hash( field_data.histogram );
-          var histogram_legend = '';
-
-          histogram_holder_element
-            .show();
-
+          var histogram_entries = [];
+          
+          var histogram_max = null;
           for( var key in histogram_values )
           {
-            histogram_legend += '<dt><span>' + key + '</span></dt>'
+ "\n" +
-                    '<dd title="' + key + '">' +
-                    '<span>' + histogram_values[key] + '</span>' +
-                    '</dd>' + "\n";
+            histogram_max = Math.max( histogram_max, histogram_values[key] );
           }
 
-          $( 'dl', histogram_holder_element )
-            .html( histogram_legend );
-
-          var histogram_values = luke_array_to_struct( field_data.histogram ).values;
-
-          histogram_element
-            .sparkline
+          for( var key in histogram_values )
+          {
+            histogram_entries.push
             (
-              histogram_values,
-              {
-                type : 'bar',
-                barColor : '#c0c0c0',
-                zeroColor : '#000000',
-                height : histogram_element.height(),
-                barWidth : 46,
-                barSpacing : 3
-              }
+              '<li>' + "\n" +
+              '  <dl class="clearfix" style="width: ' +  ( ( histogram_values[key] / histogram_max
) * 100 ) + '%;">' + "\n" +
+              '    <dt><span>' + app.format_number( key ) + '</span></dt>'
+ "\n" +
+              '    <dd><span>' + app.format_number( histogram_values[key] ) +
'</span></dd>' + "\n" +
+              '  </dl>' + "\n" +
+              '</li>'
             );
+          }
+
+          $( 'ul', histogram_holder_element )
+            .html( histogram_entries.join( "\n" ) );
+
+          $( 'ul li:even', histogram_holder_element )
+            .addClass( 'odd' );
 
-          1 === histogram_values.length
-            ? histogram_element.addClass( 'single' )
-            : histogram_element.removeClass( 'single' );
+          var max_width = 10 + Math.max.apply( Math, $( 'dt', histogram_holder_element ).map(
get_width ).get() );
+          additional_styles.push
+          (
+            histogram_holder_element.selector + ' ul { margin-left: ' + max_width + 'px !important;
}' + "\n" +
+            histogram_holder_element.selector + ' li dt { left: ' + ( max_width * -1 ) +
'px !important; width: ' + max_width + 'px !important; }'
+          );
         }
 
+        if( additional_styles )
+        {
+          terminfo_element
+            .prepend( '<style type="text/css">' + additional_styles.join( "\n" ) +
'</style>' );
+        }
       },
       error : function( xhr, text_status, error_thrown)
       {
+        terminfo_element
+          .addClass( 'disabled' );
       },
       complete : function( xhr, text_status )
       {
+        $( 'span', trigger_element )
+          .removeClass( 'loader' );
       }
     }
   );

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/tpl/schema-browser.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/tpl/schema-browser.html?rev=1438901&r1=1438900&r2=1438901&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/tpl/schema-browser.html (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/tpl/schema-browser.html Sat Jan 26 15:02:42
2013
@@ -158,12 +158,8 @@ limitations under the License.
 
             <p class="head">Histogram:</p>
 
-            <div class="histogram"></div>
+            <ul></ul>
 
-            <dl class="clearfix">
-
-            </dl>
-                    
           </div>
 
         </div>



Mime
View raw message