I have a Java-based application and a set of keywords in a MySQL database (only about 3 M keywords, each of which can include more than one word, for example, it can be: “memory”, “old house”, European Union Law "etc.).
The user interacts with the application by downloading a document with arbitrary text (several pages in most cases). I want to search if and where in the document any of the 3 million keywords appears.
I tried using a loop and looking for a document for each keyword, but this is inefficient at all. I am wondering if there is a library to do the search in a more efficient way.
I would really appreciate any help.
source share