Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] Too many clauses
Date: Sun, 09 Dec 2007 11:44:43 -0800	[thread overview]
Message-ID: <1197229372-sup-8664@south> (raw)
In-Reply-To: <20071203195238.GA1174@Nyx.cs.uiuc.edu>

Excerpts from Dennis Griffith's message of Mon Dec 03 11:52:38 -0800 2007:
> I started getting this crash upon start after updating to 0.3 from 0.1.
> --- Ferret::StateError from thread: load threads for thread-index-mode
> State Error occured at <except.c>:93 in xraise
> Error occured in q_boolean.c:1595 - bq_add_query_nr
> 	Two many clauses. The max clause limit is set to <1024> but your query has <1024> clauses. You can try increasing :max_clause_count for the BooleanQuery or using a different type of query.
> 
> /usr/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/index.rb:270:in `add_query'

At first, I thought, "Great! An error message that contains its own
solution!" But the max_clause_count thing seems to have disappeared in
recent versions of Ferret.

Can you try this patch, please?

  --- lib/sup/index.rb    (revision 748)
  +++ lib/sup/index.rb    (working copy)
  @@ -236,6 +236,7 @@
     ## true, stops loading any thread if a message with a :killed flag
     ## is found.
     SAME_SUBJECT_DATE_LIMIT = 7
  +  MAX_CLAUSES = 1000
     def each_message_in_thread_for m, opts={}
       #Redwood::log "Building thread for #{m.id}: #{m.subj}"
       messages = {}
  @@ -264,13 +265,16 @@
   
       until pending.empty? || (opts[:limit] && messages.size >= opts[:limit])
         q = Ferret::Search::BooleanQuery.new true
  +      # this disappeared in newer ferrets... wtf.
  +      # q.max_clause_count = 2048
   
  -      pending.each do |id|
  +      lim = [MAX_CLAUSES / 2, pending.length].min
  +      pending[0 ... lim].each do |id|
           searched[id] = true
           q.add_query Ferret::Search::TermQuery.new(:message_id, id), :should
           q.add_query Ferret::Search::TermQuery.new(:refs, id), :should
         end
  -      pending = []
  +      pending = pending[lim .. -1]
   
         q = build_query :qobj => q

Thanks,

-- 
William <wmorgan-sup at masanjin.net>


  reply	other threads:[~2007-12-09 19:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 19:52 Dennis Griffith
2007-12-09 19:44 ` William Morgan [this message]
2007-12-10  1:31   ` Dennis Griffith
2007-12-10  2:54     ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1197229372-sup-8664@south \
    --to=wmorgan-sup@masanjin.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox