-
Notifications
You must be signed in to change notification settings - Fork 20
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
Exception in Search when query is "apache" or "java" #1
Comments
Hi, I'm not totally sure, but I think this error is because your index contains some data that have been deleted from the database (an item has been found in the lucene index but does not exist in the database). Perhaps you're using an old index, that you have created on your development host and that it not synchronized with the production database? |
So pehaps you should just call Search.reindex in a job (for example in a @OnApplicationStart job, this way your index would be correctly synchronized at each application start) |
Hi, The module maintains a Lucene index per class. When you're making a full text query, the index will return a collection of JPA object id matching your search, and try to load them from the DB. The error you're reporting occurs when the object is in the index but not in the DB anymore. This might happen in dev mode, likely if you clear your database using fixtures ou direct JDBC. As Guillaume said, you can call Search.reindex whenever you want, il will cause the index to be deleted and re-created using the data in your DB. You can also simply add |
Should be okay now |
Yes, fixed. The error was due to an invalid Lucene index, after adding a new field in my Entity. Sorry for the late notice. |
I installed successfully the Search module.
However, when I search for "apache" or "java", the following exception is thrown
Internal Server Error (500) for request GET /search?s=apache
Oops: UnexpectedException
An unexpected error occured caused by exception UnexpectedException: Unexpected Error
play.exceptions.UnexpectedException: Unexpected Error
at play.modules.search.Search$Query.fetch(Search.java:159)
at models.JobPost.search(JobPost.java:128)
at controllers.Application.search(Application.java:55)
at play.utils.Java.invokeStatic(Java.java:129)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:138)
at Invocation.HTTP Request(Play!)
Caused by: play.exceptions.UnexpectedException: Unexpected Error
at play.modules.search.Search$Query.executeQuery(Search.java:235)
at play.modules.search.Search$Query.fetch(Search.java:152)
... 5 more
Caused by: play.modules.search.Search$SearchException: Please re-index
at play.modules.search.Search$Query.executeQuery(Search.java:215)
... 6 more
If I search for "test" or "toto" it works like a charm.
Thanks for your help
Nicolas Martignole
The text was updated successfully, but these errors were encountered: