How to improve the performance of keyword matching

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.