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

Enabling "Wildcard at the start" breaks lucene requests #68

Open
dmitriim opened this issue Oct 28, 2020 · 1 comment
Open

Enabling "Wildcard at the start" breaks lucene requests #68

dmitriim opened this issue Oct 28, 2020 · 1 comment
Labels

Comments

@dmitriim
Copy link
Contributor

Steps to replicate:

  1. Assuming you have global search configured to use elastic search
  2. Go to /admin/settings.php?section=elasticsettings and enable "Wildcard at the start"
  3. Search for title:news

Error: Error executing query in search engine: Failed to parse query [*title:news]

@dmitriim dmitriim added the bug label Oct 28, 2020
@dmitriim
Copy link
Contributor Author

Some tips for debugging/fixing from @mattporritt :

Also some depending on the index field type wildcards might not be supported.
The way I debug this is by using curl to send json queries directly to elastic
that way you can take Moodle completely out of it.
and see what the JSON looks like exaclt that you are sending and then see the complete response elastic sends back
once you've got the json doing what you want, you can then concentrate on getting moodle constructing it correctly
then you can write a unit test to cover it
it's a bit of a journey figuring out how to structure a query that elastic likes and does what you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant