Skip to content

Commit

Permalink
search queries by keyword instead or grouped by 3 when not too many k…
Browse files Browse the repository at this point in the history
…eywords requested
  • Loading branch information
boogheta committed Nov 5, 2020
1 parent 15455db commit 436f6c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gazouilloire/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@ def searcher(pile, searchco, searchco2, keywords, urlpieces, timed_keywords, loc
fmtkeywords.append(format_keyword(k))
for q in urlpieces:
fmtkeywords.append('url:"%s"' % format_url_query(q))
queries += [" OR ".join(a) for a in chunkize(fmtkeywords, 3)]
if len(fmtkeywords) > 50:
queries += [" OR ".join(a) for a in chunkize(fmtkeywords, 3)]
else:
queries += fmtkeywords
timed_queries = {}
state = {q: 0 for q in queries + [format_keyword(k) for k in timed_keywords.keys()]}
try:
Expand Down

0 comments on commit 436f6c8

Please sign in to comment.