lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1640099 [4/4] - in /lucene/dev/branches/lucene6005: ./ dev-tools/ dev-tools/scripts/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/common/src/java/org/apache/lucene/analysis/sr/ lucene/analysis/common/src/resources/META-...
Date Mon, 17 Nov 2014 08:47:36 GMT
Modified: lucene/dev/branches/lucene6005/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java?rev=1640099&r1=1640098&r2=1640099&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java
(original)
+++ lucene/dev/branches/lucene6005/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java
Mon Nov 17 08:47:34 2014
@@ -19,13 +19,17 @@ package org.apache.solr.spelling.suggest
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.search.suggest.Lookup;
 import org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester;
-import org.apache.lucene.search.suggest.analyzing.BlendedInfixSuggester.BlenderType;
 import org.apache.lucene.search.suggest.analyzing.BlendedInfixSuggester;
+import org.apache.lucene.search.suggest.analyzing.BlendedInfixSuggester.BlenderType;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.schema.FieldType;
@@ -100,7 +104,25 @@ public class BlendedInfixLookupFactory e
       return new BlendedInfixSuggester(core.getSolrConfig().luceneMatchVersion, 
                                        FSDirectory.open(new File(indexPath).toPath()),
                                        indexAnalyzer, queryAnalyzer, minPrefixChars,
-                                       blenderType, numFactor, true);
+                                       blenderType, numFactor, true) {
+        @Override
+        public List<LookupResult> lookup(CharSequence key, Set<BytesRef> contexts,
int num, boolean allTermsRequired, boolean doHighlight) throws IOException {
+          List<LookupResult> res = super.lookup(key, contexts, num, allTermsRequired,
doHighlight);
+          if (doHighlight) {
+            List<LookupResult> res2 = new ArrayList<>();
+            for(LookupResult hit : res) {
+              res2.add(new LookupResult(hit.highlightKey.toString(),
+                                        hit.highlightKey,
+                                        hit.value,
+                                        hit.payload,
+                                        hit.contexts));
+            }
+            res = res2;
+          }
+
+          return res;
+        }
+      };
     } catch (IOException e) {
       throw new RuntimeException();
     }

Modified: lucene/dev/branches/lucene6005/solr/webapp/web/css/styles/files.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/solr/webapp/web/css/styles/files.css?rev=1640099&r1=1640098&r2=1640099&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/solr/webapp/web/css/styles/files.css (original)
+++ lucene/dev/branches/lucene6005/solr/webapp/web/css/styles/files.css Mon Nov 17 08:47:34
2014
@@ -23,6 +23,11 @@ limitations under the License.
   width: 20%;
 }
 
+#content #files #tree-holder li
+{
+  overflow: hidden;
+}
+
 #content #files form .buttons button
 {
   float: right;

Modified: lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/files.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/files.js?rev=1640099&r1=1640098&r2=1640099&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/files.js (original)
+++ lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/files.js Mon Nov 17 08:47:34
2014
@@ -103,6 +103,7 @@ sammy.get
                           data: {
                             title : file,
                             attr : {
+                              title : file,
                               href : '#/' + current_core + '/files?file=' + prefix + file
                             }
                           },
@@ -161,7 +162,7 @@ sammy.get
 
           var endpoint = file_endpoint + '?file=' + selected_file;
 
-          var content_type_map = { xml : 'text/xml', html : 'text/html', js : 'text/javascript'
};
+          var content_type_map = { xml : 'text/xml', html : 'text/html', js : 'text/javascript',
json : 'application/json', 'css' : 'text/css' };
           var file_ext = selected_file.match( /\.(\w+)$/  );
           endpoint += '&contentType=' + ( content_type_map[ file_ext[1] || '' ] || 'text/plain'
) + ';charset=utf-8';
 
@@ -209,6 +210,14 @@ sammy.get
                   {
                     highlight = 'javascript';
                   }
+                  else if( 0 === content_type.indexOf( 'text/css' ) )
+                  {
+                    highlight = 'css';
+                  }
+                  else if( 0 === content_type.indexOf( 'application/json' ) )
+                  {
+                    highlight = 'json';
+                  }
 
                   var code = $(
                     '<pre class="syntax' + ( highlight ? ' language-' + highlight : ''
)+ '"><code>' +

Modified: lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/index.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/index.js?rev=1640099&r1=1640098&r2=1640099&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/index.js (original)
+++ lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/index.js Mon Nov 17 08:47:34
2014
@@ -257,7 +257,7 @@ sammy.get
               .show();
           }
 
-          var commandLineArgs = app.dashboard_values['jvm']['jmx']['commandLineArgs'];
+          var commandLineArgs = app.dashboard_values['jvm']['jmx']['commandLineArgs'].sort().reverse();
           if( 0 !== commandLineArgs.length )
           {
             var cmd_arg_element = $( '.command_line_args dt', this );

Modified: lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/plugins.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/plugins.js?rev=1640099&r1=1640098&r2=1640099&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/plugins.js (original)
+++ lucene/dev/branches/lucene6005/solr/webapp/web/js/scripts/plugins.js Mon Nov 17 08:47:34
2014
@@ -235,21 +235,21 @@ var render_plugin_data = function( plugi
           }
 
           content += '<li><dl class="clearfix">' + "\n";
-          content += '<dt>' + detail_key + ':</dt>' + "\n";
+          content += '<dt>' + detail_key.esc() + ':</dt>' + "\n";
           if($.isArray(detail_value)) {
             $.each(detail_value, function(index, value) { 
-              content += '<dd>' + value + '</dd>' + "\n";
+              content += '<dd>' + value.esc() + '</dd>' + "\n";
             });
           }
           else {
-            content += '<dd>' + detail_value + '</dd>' + "\n";
+            content += '<dd>' + new String( detail_value ).esc() + '</dd>' +
"\n";
           }
           content += '</dl></li>' + "\n";
         }
         else if( 'stats' === detail_key && details[detail_key] )
         {
           content += '<li class="stats clearfix">' + "\n";
-          content += '<span>' + detail_key + ':</span>' + "\n";
+          content += '<span>' + detail_key.esc() + ':</span>' + "\n";
           content += '<ul>' + "\n";
 
           for( var stats_key in details[detail_key] )
@@ -258,8 +258,8 @@ var render_plugin_data = function( plugi
             stats_value = stats_value.replace( /([\(@])/g, '$1&#8203;' );
 
             content += '<li><dl class="clearfix">' + "\n";
-            content += '<dt>' + stats_key + ':</dt>' + "\n";
-            content += '<dd>' + stats_value + '</dd>' + "\n";
+            content += '<dt>' + stats_key.esc() + ':</dt>' + "\n";
+            content += '<dd>' + stats_value.esc() + '</dd>' + "\n";
             content += '</dl></li>' + "\n";
           }
 



Mime
View raw message