Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/r/e/redis-search-py-HEAD/redis_search/index.py   redis-search-py(Download)
 
import util
from util import split_words, split_pinyin, utf8, mk_sets_key, mk_score_key, mk_condition_key, mk_complete_key
 
class index(object):
 
        for word in words:
            key = mk_sets_key(self.name, word)
 
            # word index for item id
 
        for word in words:
            key = mk_sets_key(name, word)
 
            pipe.srem(key, id)
            pipe.delete(mk_score_key(name, id))
 
        # remove set for prefix index key
        pipe.srem(mk_sets_key(name, title, id))
        pipe = util.redis.pipeline()
 
        pipe.sadd(mk_sets_key(self.name, self.title), self.id)
 
        if util.pinyin_match:

src/r/e/redis-search-py-HEAD/redis_search/query.py   redis-search-py(Download)
 
import util
from util import split_words, split_pinyin, utf8, mk_sets_key, mk_score_key, mk_condition_key, mk_complete_key
 
def query(name, text, offset=0, limit=10, sort_field='id', conditions=None):
    words = []
    for word in splited_words:
        words.append(mk_sets_key(name, word))
 
    condition_keys = []
            pinyin_words = []
            for w in splited_pinyin_words:
                pinyin_words.append(mk_sets_key(name, w))
 
            pinyin_words += condition_keys
    words = []
    for word in prefix_matchs:
        words.append(mk_sets_key(name, word))
 
    # 组合特别 key ,但这里不会像 query 那样放入 words, 因为在 complete 里面 words 是用 union 取的,condition_keys 和 words 应该取交集