You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by st...@apache.org on 2013/01/12 03:37:41 UTC

svn commit: r1432361 - in /lucene/dev/trunk/solr: CHANGES.txt webapp/web/css/styles/query.css webapp/web/js/scripts/query.js webapp/web/tpl/query.html

Author: steffkes
Date: Sat Jan 12 02:37:41 2013
New Revision: 1432361

URL: http://svn.apache.org/viewvc?rev=1432361&view=rev
Log:
SOLR-3820: Solr Admin Query form is missing some edismax request parameters

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/webapp/web/css/styles/query.css
    lucene/dev/trunk/solr/webapp/web/js/scripts/query.js
    lucene/dev/trunk/solr/webapp/web/tpl/query.html

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1432361&r1=1432360&r2=1432361&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Sat Jan 12 02:37:41 2013
@@ -509,6 +509,9 @@ Bug Fixes
 
 * SOLR-4291: Harden the Overseer work queue thread loop. (Mark Miller)
 
+* SOLR-3820: Solr Admin Query form is missing some edismax request parameters
+  (steffkes)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/trunk/solr/webapp/web/css/styles/query.css
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/css/styles/query.css?rev=1432361&r1=1432360&r2=1432361&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/css/styles/query.css (original)
+++ lucene/dev/trunk/solr/webapp/web/css/styles/query.css Sat Jan 12 02:37:41 2013
@@ -26,16 +26,22 @@
   width: 100%;
 }
 
+#content #query #form input,
+#content #query #form textarea
+{
+  width: 98%;
+}
+
 #content #query #form #start
 {
   float: left;
-  margin-right: 2%;
-  width: 49%;
+  width: 45%;
 }
 
 #content #query #form #rows
 {
-  width: 49%;
+  float: right;
+  width: 45%;
 }
 
 #content #query #form .checkbox input

Modified: lucene/dev/trunk/solr/webapp/web/js/scripts/query.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/query.js?rev=1432361&r1=1432360&r2=1432361&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/scripts/query.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/scripts/query.js Sat Jan 12 02:37:41 2013
@@ -113,27 +113,38 @@ sammy.get
             'submit',
             function( event )
             {
-              var form_map = {};
               var form_values = [];
-              var all_form_values = query_form.formToArray();
-
-              for( var i = 0; i < all_form_values.length; i++ )
+ 
+              var add_to_form_values = function add_to_form_values( fields )
               {
-                if( !all_form_values[i].value || 0 === all_form_values[i].value.length )
-                {
-                  continue;
-                }
-
-                var name_parts = all_form_values[i].name.split( '.' );
-                if( 1 < name_parts.length && !form_map[name_parts[0]] )
-                {
-                  console.debug( 'skip "' + all_form_values[i].name + '", parent missing' );
-                  continue;
-                }
-
-                form_map[all_form_values[i].name] = all_form_values[i].value;
-                form_values.push( all_form_values[i] );
-              }
+                 for( var i in fields )
+                 {
+                  if( !fields[i].value || 0 === fields[i].value.length )
+                  {
+                    continue;
+                  }
+ 
+                  form_values.push( fields[i] );
+                 }
+              };
+ 
+              var fieldsets = $( '> fieldset', query_form );
+ 
+              var fields = fieldsets.first().formToArray();
+              add_to_form_values( fields );
+
+              fieldsets.not( '.common' )
+                .each
+                (
+                  function( i, set )
+                  {
+                    if( $( 'legend input', set ).is( ':checked' ) )
+                    {
+                      var fields = $( set ).formToArray();
+                      add_to_form_values( fields );
+                    }
+                  }
+                );
 
               var handler_path = $( '#qt', query_form ).val();
               if( '/' !== handler_path[0] )
@@ -144,7 +155,13 @@ sammy.get
 
               var query_url = window.location.protocol + '//' + window.location.host
                             + core_basepath + handler_path + '?' + $.param( form_values );
-                            
+
+              var custom_parameters = $( '#custom_parameters', query_form ).val();
+              if( custom_parameters && 0 !== custom_parameters.length )
+              {
+                query_url += '&' + custom_parameters.replace( /^&/, '' ); 
+              }
+
               url_element
                 .attr( 'href', query_url )
                 .text( query_url )

Modified: lucene/dev/trunk/solr/webapp/web/tpl/query.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/tpl/query.html?rev=1432361&r1=1432360&r2=1432361&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/tpl/query.html (original)
+++ lucene/dev/trunk/solr/webapp/web/tpl/query.html Sat Jan 12 02:37:41 2013
@@ -48,8 +48,10 @@ limitations under the License.
           <a rel="help">start</a>,
           <a rel="help">rows</a>
         </label>
-        <input type="text" name="start" id="start" placeholder="0" pattern="[0-9]+" title="Number of leading documents to skip. (Integer)">
-        <input type="text" name="rows" id="rows" placeholder="10" pattern="[0-9]+" title="Number of documents to return after 'start'. (Integer)">
+        <div class="clearfix">
+          <input type="text" name="start" id="start" placeholder="0" pattern="[0-9]+" title="Number of leading documents to skip. (Integer)">
+          <input type="text" name="rows" id="rows" placeholder="10" pattern="[0-9]+" title="Number of documents to return after 'start'. (Integer)">
+        </div>
 
         <label for="fl">
           <a rel="help">fl</a>
@@ -61,6 +63,11 @@ limitations under the License.
         </label>
         <input type="text" name="df" id="df" value="" title="Default search field">
 
+        <label for="custom_parameters">
+          <a rel="help">Raw Query Parameters</a>
+        </label>
+        <input type="text" id="custom_parameters" value="" placeholder="key1=val1&amp;key2=val2">
+
         <label for="wt">
           <a rel="help">wt</a>
         </label>
@@ -160,6 +167,34 @@ limitations under the License.
 
         <label for="edismax_bf">bf</label>
         <input type="text" name="bf" id="edismax_bf" title="Boost function (added).">
+
+        <label for="edismax_uf" title="User Fields">uf</label>
+        <input type="text" name="uf" id="edismax_uf">
+
+        <label for="edismax_pf2" title="bigram phrase boost fields">pf2</label>
+        <input type="text" name="pf2" id="edismax_pf2">
+
+        <label for="edismax_pf3" title="trigram phrase boost fields">pf3</label>
+        <input type="text" name="pf3" id="edismax_pf3">
+
+        <label for="edismax_ps2" title="phrase slop for bigram phrases">ps2</label>
+        <input type="text" name="ps2" id="edismax_ps2">
+
+        <label for="edismax_ps3" title="phrase slop for trigram phrases">ps3</label>
+        <input type="text" name="ps3" id="edismax_ps3">
+
+        <label for="edismax_boost" title="multiplicative boost function">boost</label>
+        <input type="text" name="boost" id="edismax_boost">
+
+        <label for="edismax_stopwords" class="checkbox" title="remove stopwords from mandatory 'matching' component">
+          <input type="checkbox" name="stopwords" id="edismax_stopwords" value="true" checked="checked">
+          stopwords
+        </label>
+
+        <label for="edismax_lowercaseOperators" class="checkbox" title="Enable lower-case 'and' and 'or' as operators">
+          <input type="checkbox" name="lowercaseOperators" id="edismax_lowercaseOperators" value="true" checked="checked">
+          lowercaseOperators
+        </label>
       
         </div>
       </fieldset>