Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis: search suggestions #1

Closed
macbre opened this issue Jul 29, 2016 · 4 comments
Closed

Redis: search suggestions #1

macbre opened this issue Jul 29, 2016 · 4 comments

Comments

@macbre
Copy link
Owner

macbre commented Jul 29, 2016

$ redis-cli 
127.0.0.1:6379> ZADD autocomplete 0 poznańskiego 0 poznań 0 tej 0 tak
(integer) 4

127.0.0.1:6379> ZRANGEBYLEX autocomplete [poz "[poz\xff" LIMIT 0 10
1) "pozna\xc5\x84"
2) "pozna\xc5\x84skiego"

http://www.opensearch.org/Specifications/OpenSearch/Extensions/Suggestions/1.1

["sea",
  ["sears",
   "search engines",
   "search engine",
   "search",
   "sears.com",
   "seattle times"],
  ["7,390,000 results",
   "17,900,000 results",
   "25,700,000 results",
   "1,220,000,000 results",
   "1 result",
   "17,600,000 results"],
  ["http://example.com?q=sears",
   "http://example.com?q=search+engines",
   "http://example.com?q=search+engine",
   "http://example.com?q=search",
   "http://example.com?q=sears.com",
   "http://example.com?q=seattle+times"]]
@macbre
Copy link
Owner Author

macbre commented Jul 30, 2016

$ make stopwords 
zcat ../wbc/106644.xml.gz | docker-compose run sphinx indexer wbc -c /opt/sphinx.conf --buildfreqs --buildstops /dev/stdout 250000 > stopwords.txt
cat stopwords.txt | docker-compose run app stopwords
INFO:get_redis:Connected to StrictRedis<ConnectionPool<Connection<host=redis,port=6379,db=0>>>
INFO:StopWords:Indexing stopwords...
INFO:StopWords:Indexed 145192 stopwords in 5.46 sec

@macbre
Copy link
Owner Author

macbre commented Jul 30, 2016

d89f62a

@macbre macbre closed this as completed Jul 30, 2016
@macbre
Copy link
Owner Author

macbre commented Jul 30, 2016

[
"żeg",
[
"żegadło",
"żegierskich",
"żegierskie",
"żegierszczanie",
"żeglarska",
"żeglarski",
"żeglarskich",
"żeglarskie",
"żeglarskiego",
"żeglarskiej",
"żeglarską",
"żeglarstwa",
"żeglarstwo",
"żeglarz",
"żeglarza",
"żeglarze",
"żeglarzy",
"żeglownego",
"żegludze",
"żegluga"
]
]

@macbre
Copy link
Owner Author

macbre commented Jul 31, 2016

INFO:StopWords:Indexing stopwords...
INFO:get_redis:Connected to StrictRedis<ConnectionPool<Connection<host=redis,port=6379,db=0>>>
INFO:StopWords:Indexed 235337 stopwords in 8.81 sec

macbre added a commit that referenced this issue Aug 2, 2016
@macbre macbre changed the title Redis: autosugestia Redis: search suggestions Nov 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant