Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MATCH and OR in the same query #1604

Closed
vazul opened this issue Nov 20, 2023 · 2 comments
Closed

MATCH and OR in the same query #1604

vazul opened this issue Nov 20, 2023 · 2 comments

Comments

@vazul
Copy link

vazul commented Nov 20, 2023

Describe the bug
The MATCH() followed by an OR is causing error:
ERROR 1064 (42000): P01: syntax error, unexpected OR, expecting $end near ...

To Reproduce

  1. create table t (m text);
  2. insert into t values (1, 'apple');
  3. insert into t values (2, 'pear');
  4. insert into t values (3, 'pear with apple');
  5. insert into t values (4, 'plum');
  6. select * from t where MATCH('@m apple') OR id > 3;

Expected behavior
The select should return documents with id 1,3 and 4

Describe the environment:

  • Manticore Search version: 6.2.12 dc5144d35@230822 and 5.0.2 348514c@220530 also
  • OS version (uname -a if on a Unix-like system): Amazon Linux 5.10.118-111.515.amzn2.x86_64 1 SMP

Additional context
If I put an AND after the MATCH(), the error won't appear, but result will be wrong, missing documents matching the conditions after OR, e.g.:
select * from t where MATCH('@m apple') AND id > 0 OR id > 3;
The result should contain document with id 4, but missing:
mysql> select * from t where MATCH('@m apple') AND id > 0 OR id > 3;
+------+-----------------+
| id | m |
+------+-----------------+
| 3 | pear with apple |
| 1 | apple |
+------+-----------------+
mysql>

@vazul
Copy link
Author

vazul commented Nov 20, 2023

Ohh... Just realized:
https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#MATCH
Full-text match clauses can be combined with attribute filters as an AND boolean. OR relations between full-text matches and attribute filters are not supported.

@vazul
Copy link
Author

vazul commented Nov 20, 2023

Ok, this is by design...

@vazul vazul closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant