Similarity to Big Data lookup-some ideas about Mysql Article matching and how to improve query speed, mysql matching
The idea of relevance matching in the article is "compressing" the prediction database, that is, extracting the feature words or word frequency, and then quantifying them and saving them to the database in the form of "column vector; the first N words are combined as vector groups for query, that is, a combination of 1 to N words. After quantification, they are saved to the database in the form of "row vectors" (currently MYSQL is used ), when similarity calculation and query are performed, the feature is extracted first, then quantified, and then the Long numeric fields are queried. The speed should be faster than that of normal queries.
Application Example: [These are speculation, and we hope to have better results.]
Assume that the following features are queried:
Dictionary <string, int> words = new Dictionary <string, int> (); words. add ("five strokes", 1); words. add ("pinyin", 1); words. add ("strokes", 1); words. add ("other", 1); words. add ("English disk", 1); words. add ("US disk", 1); words. add ("disk", 1); // List <Dictionary <int, long> WordList = new List <Dictionary <int, long> (); // for (int I = 0; I <15; I ++) // {// WordList. add (GetWordSecurity (words, I + 1); // view the data Dictionary <int, long> R1 = GetWordSecurity (words, 1); Dictionary <int, long> R2 = GetWordSecurity (words, 2); Dictionary <int, long> R3 = GetWordSecurity (words, 3); Dictionary <int, long> R4 = GetWordSecurity (words, 4); Dictionary <int, long> R5 = GetWordSecurity (words, 5); Dictionary <int, long> R6 = GetWordSecurity (words, 6); Dictionary <int, long> R7 = GetWordSecurity (words, 7); Dictionary <int, long> R8 = GetWordSecurity (words, 8); Dictionary <int, long> R9 = GetWordSecurity (words, 9); Dictionary <int, long> R10 = GetWordSecurity (words, 10); Dictionary <int, long> R11 = GetWordSecurity (words, 11); Dictionary <int, long> R12 = GetWordSecurity (words, 12); Dictionary <int, long> R13 = GetWordSecurity (words, 13); Dictionary <int, long> R14 = GetWordSecurity (words, 14 );
Either of the following methods can be used to quantify data
Five pen-8683246507546018072 pinyin 5720075168044685354 strokes 6444854990336207024 others-4797408270696495584 English disk-1741849883950345011 us disk 4116094244106799890 French disk 5071717547464226258
Query the following values:
Dictionary <int, long> R1 = GetWordSecurity (words, 1); + [0] {[1,-2963171339501332718]} System. collections. generic. keyValuePair <int, long> + [1] {[2,-2238391517209811048]} System. collections. generic. keyValuePair <int, long> + [2] {[3, 4966089295467037960]} System. collections. generic. keyValuePair <int, long> + [3] {[4,-6281813915328659238]} System. collections. generic. keyValuePair <int, long> + [4] {[5, 922666897348189770]} System. collections. generic. keyValuePair <int, long> + [5] {[6, 3978225284094340343]} System. collections. generic. keyValuePair <int, long> + [6] {[7,-8610574661558066372]} System. collections. generic. keyValuePair <int, long> Dictionary <int, long> R2 = GetWordSecurity (words, 2 );