I have a custom algorithm (written in java) to search in a list of strings (A) the string that is the longest substring of another string (B) (the longest common substring alg it's not suited in this case because the list of strings is big 100k+ ).
EX:
B -> "sadsaf dsfsc adsa 4 sad3 dfa fgs adsafd"
A -> ["fdsdf dsa", "adsa", "4 sad3", "cdsdfds dsa", "cx d45"]
And the result is "4 sad3" since its a subtring of B and also is
longer than "adsa" which is also a substring of B
I'm trying to find an alternative to a search algorithm using a system/service/database in order to externalize this algorithm .
What i've tried till now is:
- mysql but it's pretty slow and it requires at least a ssd and a powerful cpu
- elasticsearch using percolate query which i didn't benchmark yet but seems promising
- redis but i didn't found a way to replicate the alg using their syntax
So any suggestion regarding a system/service/database that can do this relatively decent in terms of performance is appreciated, since the more options i'll have then the better (faster) the solution will be.