Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] More gmail search goodness
@ 2007-11-27 22:34 Marcus Williams
  2007-12-23  0:45 ` William Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Williams @ 2007-11-27 22:34 UTC (permalink / raw)


Simple patch attached. Adds the "during" operator to the date searches
so you can say during:today or during:november . I prefer it to in/on
today :)

Also adds an alias for the label search of "is" so that you can do
more gmail like searches is:starred, is:unread, is:spam, is:deleted.
The last two required changing the return value to a list/pair in
parse_user_string_query and I'm not sure what the best way to do this
in ruby is. For now its a simple list. Also is there a better way to
deal with a nil result other than returning [nil,nil]? The first
element is the parsed query string, the second allows the parser to
add options to the query like :load_spam, :load_deleted which are then
used in the code already to drop (or not) the spam/deleted labeled
messages.

I figured you'd never want to search killed threads... and it made the
patch nastier because of the :skip_killed flag.

I'd like to add a has:attachment operator but the ferret index doesnt
appear to store enough info for this. It would be really nice to be
able to search for attachments (of certain types as well with
filename:...) I took a look at extending the index to add a new field
"filename" that contains a list of filenames attached to a message,
but this would break everyones index so I'm just requesting it as a
wishlist item rather than submitting a patch. With it you could do
wildcard filename attachment searches and the has:attachment search
would just be converted to a search for the presence of any filename. 

Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more-gmail-search-prefix-patch
Type: application/octet-stream
Size: 2972 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071127/311423df/attachment.obj 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] [PATCH] More gmail search goodness
  2007-11-27 22:34 [sup-talk] [PATCH] More gmail search goodness Marcus Williams
@ 2007-12-23  0:45 ` William Morgan
  2008-01-18 16:37   ` vasudeva
  0 siblings, 1 reply; 4+ messages in thread
From: William Morgan @ 2007-12-23  0:45 UTC (permalink / raw)


Excerpts from Marcus Williams's message of Tue Nov 27 14:34:02 -0800 2007:
> Simple patch attached. Adds the "during" operator to the date searches
> so you can say during:today or during:november.

Applied as is. Thanks!

> The last two required changing the return value to a list/pair in
> parse_user_string_query and I'm not sure what the best way to do this
> in ruby is. For now its a simple list.

That's the right way.

> Also is there a better way to deal with a nil result other than
> returning [nil,nil]?

You can just return nil.

> I figured you'd never want to search killed threads... and it made the
> patch nastier because of the :skip_killed flag.

Actually, by default, killed threads are always searched. It's only in
inbox-mode that you don't want to see them.

> I'd like to add a has:attachment operator but the ferret index doesnt
> appear to store enough info for this. It would be really nice to be
> able to search for attachments (of certain types as well with
> filename:...) I took a look at extending the index to add a new field
> "filename" that contains a list of filenames attached to a message,
> but this would break everyones index so I'm just requesting it as a
> wishlist item rather than submitting a patch.

You're right, it requires adding an attachment field to the index. I
think that adding a field to the Ferret index doesn't break index
compatibility, so this actually might not be too hard to do. You'll have
to rebuild the index to fill in the attachment status for pre-existing
messages, but the change wouldn't invalidate anyone's index.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] [PATCH] More gmail search goodness
  2007-12-23  0:45 ` William Morgan
@ 2008-01-18 16:37   ` vasudeva
  2008-01-18 17:18     ` Marcus Williams
  0 siblings, 1 reply; 4+ messages in thread
From: vasudeva @ 2008-01-18 16:37 UTC (permalink / raw)


Excerpts from William Morgan's message of Sat Dec 22 19:45:54 -0500 2007:
> Excerpts from Marcus Williams's message of Tue Nov 27 14:34:02 -0800 2007:
> >
> > I'd like to add a has:attachment operator but the ferret index doesnt
> > appear to store enough info for this. It would be really nice to be
> > able to search for attachments (of certain types as well with
> > filename:...) I took a look at extending the index to add a new field
> > "filename" that contains a list of filenames attached to a message,
> > but this would break everyones index so I'm just requesting it as a
> > wishlist item rather than submitting a patch.
> 
> You're right, it requires adding an attachment field to the index. I
> think that adding a field to the Ferret index doesn't break index
> compatibility, so this actually might not be too hard to do. You'll have
> to rebuild the index to fill in the attachment status for pre-existing
> messages, but the change wouldn't invalidate anyone's index.

Was there every any movement in this direction? Specifically, toward a
has:attachment search function?

I ask because I find myself repeatedly running out of diskspace at work
(Outlook, 100Mb PST), which is actually almost enough space, without a
particular line of business that causes customers to mail me gigantic
attachments (1.5Mb PDF containing a 20k GIF, awesome), which I then have to go
in and delete. I mucked about with ways of programmatically seeking these out
and deleting them, before it eventually dawned on me that attachment references
aren't stored in the index.

(Business like 'is:larger-than=1000k' would be nifty.)

-- 
linkswarm.com :: Collaborative Insolence
vasudeva.linkswarm.com/gallery :: For The Faint of Heart



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] [PATCH] More gmail search goodness
  2008-01-18 16:37   ` vasudeva
@ 2008-01-18 17:18     ` Marcus Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Marcus Williams @ 2008-01-18 17:18 UTC (permalink / raw)


On 18.1.2008, vasudeva wrote:
> Was there every any movement in this direction? Specifically, toward a
> has:attachment search function?

Its next on my todo list :) unless someone else has picked it up.

Marcus


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-18 17:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-27 22:34 [sup-talk] [PATCH] More gmail search goodness Marcus Williams
2007-12-23  0:45 ` William Morgan
2008-01-18 16:37   ` vasudeva
2008-01-18 17:18     ` Marcus Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox