From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.142.204.14 with SMTP id b14cs159009wfg; Wed, 6 Jul 2011 19:31:30 -0700 (PDT) Received: by 10.224.176.138 with SMTP id be10mr181658qab.235.1310005889223; Wed, 06 Jul 2011 19:31:29 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id l6si10838793qck.30.2011.07.06.19.31.28; Wed, 06 Jul 2011 19:31:29 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id B5FF81858346 for ; Wed, 6 Jul 2011 22:31:28 -0400 (EDT) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by rubyforge.org (Postfix) with ESMTP id CA3E31858300 for ; Wed, 6 Jul 2011 22:24:20 -0400 (EDT) Received: by pvg7 with SMTP id 7so189248pvg.23 for ; Wed, 06 Jul 2011 19:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; bh=PJhcULeHhat4BY1O4rWjj5Sugh4jBKh9GjpmSqxZl4s=; b=FH9OcE29+yQBPoc8PYabcg9y1H6FJv/sjuqB8JIL0VFc1xqMqOgwHGe7vls0GAjN/S BRG/Ajw7QXRjWP3JPtO4G4vh8Q3e0jmWd32f2mh2Yfyy8unvx31DhFoSYLHdcfiUhvYI wyiLeQ//6cUNfhZABXGnx9U6kpZJZpIg2691A= Received: by 10.68.62.135 with SMTP id y7mr386625pbr.195.1310005460011; Wed, 06 Jul 2011 19:24:20 -0700 (PDT) Received: from suj-panama.localnet (p210-159-196-197.sub.ne.jp [210.159.196.197]) by mx.google.com with ESMTPS id i9sm5267494pbk.36.2011.07.06.19.24.18 (version=SSLv3 cipher=OTHER); Wed, 06 Jul 2011 19:24:18 -0700 (PDT) From: Horacio Sanson Organization: piaotech To: sup-devel@rubyforge.org Date: Thu, 7 Jul 2011 11:24:15 +0900 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.5.5; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201107071124.16433.hsanson@gmail.com> Subject: [sup-devel] How are the queries supposed to work? X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Finally after several attempts the gmail-dumper finished indexing my +450,000 emails but searching emails does not work as I expected or I am doing something wrong. Here is an example I have been trying to understand: I am using the heliotrope-console with this command: bash> ruby1.9.1 -Ilib bin/heliotrope-console -d ~/.heliotrope Then in that console : # Create a query for EVERY index.set_query(Query.new("body", "*")) # Get first 5 matches r = index.get_some_results 5 # Inspect the one result puts r[1][:subject] => [Rails] Test fixtures not loading puts r[1][:direct_recipients].inspect => #"}> puts r[1][:snippet].inspect => PLEASE HELP. This is driving me insane. I have a simple database table puts r[1][:labels] => # # So I have a message indexed with a subject that contains "Rails" a direct recipient with "rubyonrails-talk@googlegroups.com" and a body that contains "PLEASE HELP". # Now I tried several queries that I thought would return that message but they all returned zero results: index.set_query(Query.new("body", "HELP")) index.set_query(Query.new("body", "PLEASE")) index.set_query(Query.new("labels", "unread") index.set_query(Query.new("from", "rubyonrails-talk@googlegroups.com") index.set_query(Query.new("to", "rubyonrails-talk@googlegroups.com") index.set_query(Query.new("body", "rubyonrails-talk@googlegroups.com") # And the interesting part is that these queries do return the message I expect: index.set_query(Query.new("body", "fixtures")) index.set_query(Query.new("subject", "fixtures")) # This made me think that only the subject is searchable since the word "fixtures" only appears in the subject but then these queries with words in the subject return zero results: index.set_query(Query.new("subject", "Rails")) index.set_query(Query.new("subject", "[Rails]")) index.set_query(Query.new("subject", "Test fixtures")) index.set_query(Query.new("subject", "test fixtures")) On all tests I made sure to run index.reset_query! before setting the new query with index.set_query. Is this the correct way??? -- regards, Horacio Sanson _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel