Skip to content

Apache Lucene open-source search software

SOLR-3838: Admin UI - Multiple filter queries are not supported in Query UI

Stefan Matheisf5a79d5162d9
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 73d7980165c..f78f725ce6b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -184,6 +184,8 @@ Optimizations
* SOLR-4923: Commit to all nodes in a collection in parallel rather than locally and
then to all other nodes. (hossman, Ricardo Merizalde, Mark Miller)
+* SOLR-3838: Admin UI - Multiple filter queries are not supported in Query UI (steffkes)
+
Other Changes
----------------------
diff --git a/solr/webapp/web/css/styles/query.css b/solr/webapp/web/css/styles/query.css
index 0547e2ca101..368eca32c17 100644
--- a/solr/webapp/web/css/styles/query.css
+++ b/solr/webapp/web/css/styles/query.css
@@ -32,6 +32,44 @@
width: 98%;
}
+#content #query #form .multiple input
+{
+ float: left;
+ width: 80%
+}
+
+#content #query #form .multiple .buttons
+{
+ float: right;
+ width: 16%;
+}
+
+
+#content #query #form .multiple a
+{
+ background-position: 50% 50%;
+ display: block;
+ height: 25px;
+ width: 49%;
+}
+
+#content #query #form .multiple a span
+{
+ display: none;
+}
+
+#content #query #form .multiple a.add
+{
+ background-image: url( ../../img/ico/plus-button.png );
+ float: right;
+}
+
+#content #query #form .multiple a.rem
+{
+ background-image: url( ../../img/ico/minus-button.png );
+ float: left;
+}
+
#content #query #form #start
{
float: left;
diff --git a/solr/webapp/web/img/ico/minus-button.png b/solr/webapp/web/img/ico/minus-button.png
new file mode 100755
index 00000000000..6dc019a60b0
Binary files /dev/null and b/solr/webapp/web/img/ico/minus-button.png differ
diff --git a/solr/webapp/web/js/scripts/query.js b/solr/webapp/web/js/scripts/query.js
index 3d7bcba3e41..417fef99373 100644
--- a/solr/webapp/web/js/scripts/query.js
+++ b/solr/webapp/web/js/scripts/query.js
@@ -106,6 +106,39 @@ sammy.get
}
);
+ $( '.multiple a', query_form )
+ .die( 'click' )
+ .live
+ (
+ 'click',
+ function( event )
+ {
+ var self = $( this );
+ var row = self.closest( '.row' );
+ var container = self.closest( '.multiple' );
+
+ var add = parseInt( self.data( 'action' ), 10 );
+ if( add )
+ {
+ var new_row = row.clone();
+ new_row.find( 'input' ).val( '' );
+ row.after( new_row );
+ row.next().find( 'input' ).focus();
+ }
+ else if( 1 === $( '.row', container ).size() )
+ {
+ row.find( 'input' ).val( '' ).focus();
+ }
+ else
+ {
+ row.remove();
+ container.find( 'input:last' ).focus();
+ }
+
+ return false;
+ }
+ )
+
query_form
.die( 'submit' )
.live
diff --git a/solr/webapp/web/tpl/query.html b/solr/webapp/web/tpl/query.html
index 1bcce1f5c56..268e3117b9c 100644
--- a/solr/webapp/web/tpl/query.html
+++ b/solr/webapp/web/tpl/query.html
@@ -37,12 +37,20 @@ limitations under the License.
<label for="fq">
<a rel="help">fq</a>
</label>
- <input type="text" id="fq" name="fq" class="multiple" title="Filter query.">
+ <div class="multiple">
+ <div class="row clearfix">
+ <input type="text" id="fq" name="fq" title="Filter query.">
+ <div class="buttons">
+ <a class="rem" data-action="0"><span>[-]</span></a>
+ <a class="add" data-action="1"><span>[+]</span></a>
+ </div>
+ </div>
+ </div>
<label for="sort">
<a rel="help">sort</a>
</label>
- <input type="text" id="sort" name="sort" class="multiple" title="Sort field or function with asc|desc.">
+ <input type="text" id="sort" name="sort" title="Sort field or function with asc|desc.">
<label for="start">
<a rel="help">start</a>,