In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to use Redis participle index". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use Redis participle index method" can help you solve the problem.
Word segmentation index method
This approach is the only way I have practiced and combined with the views given by my predecessors in the previous article that it is more feasible and in line with the characteristics of redis, but in the end, it is not as efficient as memory.
For detailed implementation ideas, see the Redis author's blog (Ref. 1). The example here is still based on UserName, English, and only has a word segmentation with a length of 3 for the phrase. Please expand other scenarios.
First of all, based on the letter search of AutoComplete, then we need to do a participle for all Name, that is:
Abc = > (a, ab, abc)
Then enter a, we will directly take the contents of set a, enter ab to directly take the contents of the ab collection. So let's start the conversion, first we need to participle the name of the User table:
Var redis = ConnectionMultiplexer.Connect ("localhost"); var db = redis.GetDatabase (); for (var I = 1; I < 4) Var data +) {var data = dbCon.Lookup (string.Format (@ "select words, id from (select Row_number () over (partition by words order by name) as rn,id,words from (select id, SUBSTRING (name, 1, {0}) as words) Name from User) as t) T2 where rn
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.