mirror of https://github.com/apache/lucene.git
SOLR-3270 edismax blank q bug
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1304704 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6fc8fa052c
commit
e0141c7350
|
@ -163,7 +163,7 @@ class ExtendedDismaxQParser extends QParser {
|
|||
parsedUserQuery = null;
|
||||
String userQuery = getString();
|
||||
altUserQuery = null;
|
||||
if( userQuery == null || userQuery.length() < 1 ) {
|
||||
if( userQuery == null || userQuery.trim().length() == 0 ) {
|
||||
// If no query is specified, we may have an alternate
|
||||
String altQ = solrParams.get( DisMaxParams.ALTQ );
|
||||
if (altQ != null) {
|
||||
|
|
|
@ -72,6 +72,12 @@ public class TestExtendedDismaxParser extends AbstractSolrTestCase {
|
|||
String twor = "*[count(//doc)=2]";
|
||||
String nor = "*[count(//doc)=0]";
|
||||
|
||||
assertQ("blank q",
|
||||
req("q"," ",
|
||||
"q.alt",allq,
|
||||
"defType","edismax")
|
||||
,allr);
|
||||
|
||||
assertQ("expected doc is missing (using un-escaped edismax w/qf)",
|
||||
req("q", "literal:colon",
|
||||
"qf", "t_special",
|
||||
|
|
Loading…
Reference in New Issue