diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php index 62b8b0ded0..e1a33255a6 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryVisitor.php @@ -226,7 +226,7 @@ class QueryVisitor implements Visit continue; } if ($node instanceof AST\Context) { - if ($root instanceof ContextAbleInterface) { + if ($root instanceof AST\ContextAbleInterface) { $root = $root->withContext($node); } else { throw new \Exception('Unexpected context after non-contextualizable node'); diff --git a/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv b/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv index 185f1f9959..dd7777690f 100644 --- a/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv +++ b/tests/Alchemy/Tests/Phrasea/SearchEngine/resources/queries.csv @@ -9,6 +9,15 @@ foo bar (baz qux)| [foo (bar)]| [foo bar (baz qux)]| +# Raw string +r"foo"| +r"foo bar"| +r"\"foo\""| +r"\o/"| +r"\\o/"| +r"foo \n bar"| +r"foo\\nbar"| + # Parenthesis grouping (foo)| (foo bar)|