From f3a15fb19f34eca28411ee06065910e85a8d02a6 Mon Sep 17 00:00:00 2001 From: Mathieu Darse Date: Wed, 4 Nov 2015 12:49:49 +0100 Subject: [PATCH] Fix text merging --- .../Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php | 2 +- tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php index 471f21263e..31bd93d691 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php @@ -241,7 +241,7 @@ class QueryVisitor implements Visit throw new \Exception('Unexpected context after non-contextualizable node'); } } elseif ($node instanceof AST\Node) { - $root = new AST\AndExpression($root, $node); + $root = new AST\Boolean\AndOperator($root, $node); } else { throw new \Exception('Unexpected node type inside text node.'); } diff --git a/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv b/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv index b176aaa482..93c9c3a868 100644 --- a/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv +++ b/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv @@ -1,5 +1,7 @@ foo| foo (bar)| +foo "bar"|( AND ) +"foo" bar|( AND ) # foo ("bar baz")| foo bar| foo bar (baz qux)|