You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by eh...@apache.org on 2015/05/22 16:52:05 UTC

svn commit: r1681134 - in /lucene/dev/branches/branch_5x/solr: ./ core/src/java/org/apache/solr/handler/ core/src/java/org/apache/solr/response/transform/ core/src/java/org/apache/solr/update/processor/ example/ example/files/ webapp/web/js/angular/con...

Author: ehatcher
Date: Fri May 22 14:52:05 2015
New Revision: 1681134

URL: http://svn.apache.org/r1681134
Log:
oops, back out previous commit

Removed:
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/response/transform/HighlightingAugmenter.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/FieldsUsedUpdateProcessorFactory.java
    lucene/dev/branches/branch_5x/solr/example/files-NOTES.txt
Modified:
    lucene/dev/branches/branch_5x/solr/build.xml
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java
    lucene/dev/branches/branch_5x/solr/example/README.txt
    lucene/dev/branches/branch_5x/solr/example/files/README.txt
    lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/analysis.js
    lucene/dev/branches/branch_5x/solr/webapp/web/partials/analysis.html

Modified: lucene/dev/branches/branch_5x/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/build.xml?rev=1681134&r1=1681133&r2=1681134&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/build.xml (original)
+++ lucene/dev/branches/branch_5x/solr/build.xml Fri May 22 14:52:05 2015
@@ -208,11 +208,6 @@
       <globmapper from="*.mdtext" to="*.html"/>
     </pegdown>
 
-    <pegdown todir="${javadoc.dir}/files">
-      <fileset dir="example/files" includes="README.txt"/>
-      <globmapper from="*.txt" to="*.html"/>
-    </pegdown>
-
     <copy todir="${javadoc.dir}">
       <fileset dir="site/assets" />
     </copy>

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java?rev=1681134&r1=1681133&r2=1681134&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java Fri May 22 14:52:05 2015
@@ -23,7 +23,7 @@ import org.apache.solr.request.SolrReque
 /**An interface for RequestHandlers need to handle all paths under its registered path
  */
 public interface NestedRequestHandler {
-  /** Return a SolrRequestHandler to handle a subpath from the path this handler is registered.
+  /** Return a Requestandler to handle a subpath from the path this handler is registered.
    */
   public SolrRequestHandler getSubHandler(String subPath);
 }

Modified: lucene/dev/branches/branch_5x/solr/example/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/example/README.txt?rev=1681134&r1=1681133&r2=1681134&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/example/README.txt (original)
+++ lucene/dev/branches/branch_5x/solr/example/README.txt Fri May 22 14:52:05 2015
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-TODO: Need to update!
-
 Solr example
 ------------
 

Modified: lucene/dev/branches/branch_5x/solr/example/files/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/example/files/README.txt?rev=1681134&r1=1681133&r2=1681134&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/example/files/README.txt (original)
+++ lucene/dev/branches/branch_5x/solr/example/files/README.txt Fri May 22 14:52:05 2015
@@ -134,20 +134,23 @@ You can use the Admin_UI as a visual too
 	re-create or patch a core/collection with an updated configuration), Solr can be started with a special system property
 	set to the _absolute_ path to the conf/velocity directory, like this:
 
-	 bin/solr start -Dvelocity.template.base.dir=</full/path/to>/example/files/conf/velocity/
-
-* How do I index image files?  Or how do I get all files index?
 
-	The bin/post tool has a built-in default constrained list of file types that it will index.  (see `bin/post -h` for
-	details).  In order to index all file types, add `-filetypes "*"` (note the double quotes to avoid shell filename expansion)
-	or `-filetypes png,tiff,jpg` to index those image types.  Full example:
-
-	   bin/post -c files ~/Documents -filetypes png # to index just PNG files
+	 bin/solr start -Dvelocity.template.base.dir=</full/path/to>/example/files/conf/velocity/
+	
 	
-## Concise Script
-
 bin/solr stop
 rm -Rf server/solr/files/
-bin/solr start # -Dvelocity.template.base.dir=<absolute path to example/files/templates>
-bin/solr core -c files -d example/files/conf
+
+# templates extracted with:
+#    unzip  -j dist/solr-velocity-*.jar velocity/* -x *.properties -d example/files/templates/
+bin/solr start -Dvelocity.template.base.dir=<absolute path to example/files/templates>
+# TODO: make it so an install dir relative path can be used somehow?
+bin/solr create_core -c files
 bin/post -c files ~/Documents
+curl http://localhost:8983/solr/files/config/params -H 'Content-type:application/json'  -d '{
+"update" : {
+  "facets": {
+    "facet.field":"content_type"
+    }
+  }
+}'
\ No newline at end of file

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/analysis.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/analysis.js?rev=1681134&r1=1681133&r2=1681134&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/analysis.js (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/analysis.js Fri May 22 14:52:05 2015
@@ -17,7 +17,20 @@
 
 solrAdminApp.controller('AnalysisController',
   function($scope, $location, $routeParams, Luke, Analysis) {
-      $scope.resetMenu("analysis");
+    $scope.resetMenu("analysis");
+
+    // Read initial values from URL:
+    $scope.init = function() {
+      var params = $location.search();
+      $scope.indexText = params["analysis.fieldvalue"];
+      $scope.queryText = params["analysis.query"];
+      if (params["analysis.fieldname"]) {
+        $scope.fieldOrType = "fieldname=" + params["analysis.fieldname"];
+      } else {
+        $scope.fieldOrType = "fieldtype=" + params["analysis.fieldtype"];
+      }
+      $scope.verbose = params["verboxe_output"]=="1";
+    };
 
       $scope.refresh = function() {
         Luke.schema({core: $routeParams.core}, function(data) {
@@ -36,9 +49,20 @@ solrAdminApp.controller('AnalysisControl
           }
         });
 
-        $scope.parseQueryString();
         // @todo - if URL param, set $scope.verbose;
         // @todo - set defaultSearchField either to context["analysis.fieldname"] or context["analysis.fieldtype"]
+        /** @todo: not sure:
+                      var fields = 0;
+              for( var key in context.params )
+              {
+                if( 'string' === typeof context.params[key] && 0 !== context.params[key].length )
+                {
+                  fields++;
+                  $( '[name="' + key + '"]', analysis_form )
+                    .val( context.params[key] );
+                }
+              }
+          */
 
       };
       $scope.verbose = true;
@@ -87,85 +111,62 @@ solrAdminApp.controller('AnalysisControl
         return tokens;
       };
 
-      var extractComponents = function(data, result, name) {
-        if (data) {
-            result[name] = [];
-            for (var i = 0; i < data.length; i += 2) {
-                var component = {
-                    name: data[i],
-                    short: getShortComponentName(data[i]),
-                    captions: getCaptionsForComponent(data[i + 1]),
-                    tokens: getTokensForComponent(data[i + 1])
-                };
-                result[name].push(component);
-            }
+      var mangle = function(data) {
+        response = [];
+        for (var i=0; i < data.length; i+=2) {
+          var component = {
+            name: data[i],
+            short: getShortComponentName(data[i]),
+            captions: getCaptionsForComponent(data[i+1]),
+            tokens: getTokensForComponent(data[i+1])
+          };
+          response.push(component);
         }
+        return response;
       };
 
       var processAnalysisData = function(analysis, fieldOrType) {
         var fieldname;
+        console.log(fieldOrType);
+        console.dir(analysis[fieldOrType]);
         for (fieldname in analysis[fieldOrType]) {console.log(fieldname);break;}
-        var response = {};
-        extractComponents(analysis[fieldOrType][fieldname].index, response, "index");
-        extractComponents(analysis[fieldOrType][fieldname].query, response, "query");
+        var index = mangle(analysis[fieldOrType][fieldname].index);
+        var query = mangle(analysis[fieldOrType][fieldname].query);
+        response = {index: index, query: query};
         return response;
       };
 
-      $scope.updateQueryString = function() {
-
+      $scope.analyse = function() {
         var parts = $scope.fieldOrType.split("=");
-        var fieldOrType = parts[0];
-        var name = parts[1];
+        var fieldOrType = parts[0] == "fieldname" ? "field_names" : "field_types";
 
-        if ($scope.indexText) {
-            $location.search("analysis.fieldvalue", $scope.indexText);
-        }
-        if ($scope.queryText) {
-          $location.search("analysis.query", $scope.queryText);
-        }
+        params = {
+          "analysis.fieldvalue": $scope.indexText,
+          "analysis.query": $scope.queryText
+        };
 
-        if (fieldOrType == "fieldname") {
-          $location.search("analysis.fieldname", name);
-          $location.search("analysis.fieldtype", null);
+        if (fieldOrType == "field_names") {
+          params["analysis.fieldname"] = parts[1];
         } else {
-          $location.search("analysis.fieldtype", name);
-          $location.search("analysis.fieldname", null);
+          params["analysis.fieldtype"] = parts[1];
         }
-      };
-
-      $scope.parseQueryString = function () {
-          var params = {};
-          var search = $location.search();
 
-          if (Object.keys(search).length == 0) {
-              return;
-          }
-          for (var key in search) {
-              params[key]=search[key];
-          }
-          $scope.indexText = search["analysis.fieldvalue"];
-          $scope.queryText = search["analysis.query"];
-          if (search["analysis.fieldname"]) {
-              $scope.fieldOrType = "fieldname=" + search["analysis.fieldname"];
-          } else {
-              $scope.fieldOrType = "fieldtype=" + search["analysis.fieldtype"];
-          }
-          $scope.verbose = search["verbose_output"] == "1";
+        $location.search("analysis.fieldname", null);
+        $location.search("analysis.fieldtype", null);
+        for (var param in params) {
+          $location.search(param, params[param]);
+        }
 
-          if ($scope.fieldOrType || $scope.indexText || $scope.queryText) {
-            params.core = $routeParams.core;
-            var parts = $scope.fieldOrType.split("=");
-            var fieldOrType = parts[0] == "fieldname" ? "field_names" : "field_types";
-
-              Analysis.field(params, function(data) {
-              $scope.result = processAnalysisData(data.analysis, fieldOrType);
-            });
-          }
+        params.core = $routeParams.core;
+        Analysis.field(params, function(data) {
+          $scope.analysis = data;
+          $scope.result = processAnalysisData(data.analysis, fieldOrType);
+        });
       };
 
-
       $scope.toggleVerbose = function() {$scope.verbose = !$scope.verbose};
 
+      $scope.init();
       $scope.refresh();
     }
 );

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/partials/analysis.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/partials/analysis.html?rev=1681134&r1=1681133&r2=1681134&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/partials/analysis.html (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/partials/analysis.html Fri May 22 14:52:05 2015
@@ -41,13 +41,13 @@ limitations under the License.
           <li class="settings-holder clearfix">
             <div class="settings clearfix">
               <label for="type_or_name">Analyse Fieldname / FieldType:</label>
-              <select style="width:130px" chosen id="type_or_name" ng-model="fieldOrType" ng-options="f.value as f.label group by f.group for f in fieldsAndTypes"></select>
+              <select chosen id="type_or_name" ng-model="fieldOrType" ng-options="f.value as f.label group by f.group for f in fieldsAndTypes"></select>
 
               <a id="tor_schema" href="#"><span>Schema Browser</span>&nbsp;</a>
 
               <div class="buttons clearfix">
 
-                <button type="submit" ng-click="updateQueryString()"><span>Analyse Values</span></button>
+                <button type="submit" ng-click="analyse()"><span>Analyse Values</span></button>
 
                 <div class="verbose_output" ng-class="{active:verbose}">
                   <a ng-click="toggleVerbose()">Verbose Output</a>