| Jan-Willem Gmelig Meyling An easy way out is to simply catch the exception and handle it whatever way suits you. Ignore it if that's acceptable. As for changing Hibernate Search to handle this case, I'm a bit torn. On the one hand, yes, throwing an exception seems a bit harsh. But on the other hand, what in the world can an empty query mean? Some developers may want to not return any result in this case, forcing users to enter meaningful queries. Different use cases may require a different behavior, and simply logging a warning doesn't give users the ability to choose. I guess we could add an option to allow developers to choose the behavior when there are no meaningful terms in a query. This would make even more sense if we introduce the fuild API described in the comments of
HSEARCH-2498 Open . |