[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-devel] How are the queries supposed to work?



On Thursday 07 July 2011 15:07:41 William Morgan wrote:
> Hi Horacio,
> 
> Reformatted excerpts from Horacio Sanson's message of 2011-07-07:
> > # 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"))
> 
> These two are due to case folding. If you try "help" and "please", it
> should work.
> 

Indeed lowercasing all the queries make them work.

> > index.set_query(Query.new("labels", "unread")
> 
> This one should be Query.new("body", "~unread"). The label syntax is
> different in heliotrope from in Sup; they aren't regular fielded terms.
> 
> > 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")
> 
> This I don't quite understand. Similar queries work on my system. Would
> you be able to send the the message that this corresponds to?
> 

Sorry my mistake. The queries I did were with:
  
  "<rubyonrails-talk@googlegroups.com>"

in this case the result is zero but if I remove the "<" and ">" then I get the 
expected results. The same goes for "[rails]" that does not work unless I 
remove the square brackets.

> > index.set_query(Query.new("body", "fixtures"))
> > index.set_query(Query.new("subject", "fixtures"))
> 
> These ones work due to the lower casing.
> 
> > 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"))
> 
> I would expect the last one to work. Did it?
> 

You are rigth, the last query works correclty. Maybe I was already tired of so 
much testing and forgot to actually run the query after setting it.

> > 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???
> 
> The reset_query! is unnecessary.
> 
> Thanks for all your testing. Much of this is undocumented, so I ask you
> to bear with me.

Once the UTF-7 encoding issue with the labels get's fixed I will test querying 
with Japanese labels.

-- 
regards,                                                                                                                                                                                                       
Horacio Sanson
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel