Suppose there are 20 million or more strings, and there are 1000 keywords. Now we need to check which keywords are hit by all strings. of course, the simplest way is to use a string to match all the keywords, but the efficiency will be very slow, is there any good idea... suppose there are 20 million or more strings, and there are 1000 keywords. Now we need to check which keywords are hit by all strings. of course, the simplest way is to use a string to match all the keywords, but the efficiency will be very slow, is there any good way to improve matching efficiency?
Reply content:
Suppose there are 20 million or more strings, and there are 1000 keywords. Now we need to check which keywords are hit by all strings. of course, the simplest way is to use a string to match all the keywords, but the efficiency will be very slow, is there any good way to improve matching efficiency?
Http://blog.41ms.com/post/41.html
I am using it now. you only have 1000 keywords. I have 500 million keywords. now, concurrent queries per second are supported. This should satisfy your needs.
Use PHP extension trie_filter to filter Chinese sensitive words
Http://www.2cto.com/kf/201401/273359.html
AC_BNFA
Https://segmentfault.com/q/1010000004159234/a-1020000004162767
This should help you with the string matching algorithm.
Use ElasticSearch