After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 310464 - beagle-search shouldn't filter out by backend, but by type
beagle-search shouldn't filter out by backend, but by type
Status: RESOLVED OBSOLETE
Product: beagle
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Beagle Bugs
Beagle Bugs
: 300325 310992 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-07-15 09:18 UTC by Aviram Jenik
Modified: 2007-01-13 20:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Aviram Jenik 2005-07-15 09:18:10 UTC
Distribution/Version: Debian SID

When FilterMail goes over an email file (the log message is:
Successfully filtered <emailfilename> with Beagle.Filters.FilterMail ) the file
is indexed correctly, but appears as a 'file' and not 'mail'. This was verified
both by doing a search with 'best' (I can find the file when searching in
'files' but not when searching in 'mail') and by:
beagle-index-info
(the files count is up, but the mail count stays 0).
This was checked on both the CVS version and 0.12.
Comment 1 Lukas Lipka 2005-07-15 09:29:41 UTC

*** This bug has been marked as a duplicate of 310462 ***
Comment 2 Fredrik Hedberg 2005-07-15 11:58:58 UTC
If the file system crawler indexes a mail in a maildir on your harddrive, it
will not increase the mail count (as opposed to a mail in .evolution, as it is
handled by the separate mail backend), but the file count. This is the intended
behaviour. 

However, the UI bug of not showing up when selecting mail, is valid.
Comment 3 Aviram Jenik 2005-07-15 21:10:01 UTC
I've been running some tests, and it seems that it's not a sorting problem - the
emails filtered through FilterMail don't appear in the 'best' search results at all.

I need to confirm this, but in the meanwhile - would you like to close this bug
and have me open another once I have more info, or just edit this one with the
findings?
Comment 4 Joe Shaw 2005-07-15 21:24:47 UTC
Just edit this one.  We know what's going on.
Comment 5 Joe Shaw 2005-07-26 14:31:58 UTC
*** Bug 310992 has been marked as a duplicate of this bug. ***
Comment 6 Aviram Jenik 2005-07-29 21:38:53 UTC
Ok, just to clarify.

Indexing is done well - no problem there. The only problem is in the way the
results show up in best - emails that are indexed with FilterMail are shown as
regular files (ugly title - the long filename instead of email subject, no
keyword highlighting, etc). 

Clicking on the filename launches the mail viewer - as expected.
Comment 7 Daniel Drake 2005-08-16 22:29:38 UTC
Fixed in cvs by registering the message/rfc822 mimetype in the mail tile.
Comment 8 Joe Shaw 2005-08-18 20:00:40 UTC
Reopening this bug.  While dsd's change does cause message/rfc822 files to
display using the right tile, if you filter out certain types of hits using the
option menu the right thing doesn't happen.  That is, if you choose "in Mail"
you'll only see hits from the mail backend, not the file backend.  This is not
what we want.
Comment 9 Joe Shaw 2005-08-22 21:09:16 UTC
*** Bug 300325 has been marked as a duplicate of this bug. ***
Comment 10 Stephan Sokolow 2005-09-09 02:02:21 UTC
Filtering by type would also be a step towards the "Don't show multimedia"
option I desire. (I don't want multimedia clogging up a search when I know that
I want something from my collection of electronic fiction.)
Comment 11 Debajyoti Bera 2005-11-25 03:39:29 UTC
That would involve keeping a mapping of mimetype and document type: e.g.

message/rfc822         <-> mail
audio/mpeg             <-> multimedia
application/postscript <-> document
application/x-archive  <-> archive
etc.

Is there a reliable place to obtain the mimetype-filetype mapping ?
Comment 12 Veerapuram Varadhan 2005-11-25 09:21:54 UTC
I think maintaining a property called "document type" on filters will help us
get the desired mapping.  We can even store them as a property during
"DoPullProperties".  We will have to see the "cost" of storing it in the index,
though.
Comment 13 Lukas Lipka 2005-11-25 12:38:06 UTC
This will all be handled on the UI frontend in Holmes. Soon to land!
Comment 14 Debajyoti Bera 2005-11-25 14:54:48 UTC
Varadhan, I dont think storing it will be costly - currently there is all kind
of trash in the index anyway.
Lukas, great. Excited for holmes release.
I think you mean Holmes will do the filtering, but the type still needs to be
stored in the index - right ?
Comment 15 Lukas Lipka 2006-01-15 21:42:25 UTC
Yes, right I misread again.
Comment 16 Lukas Lipka 2006-01-16 13:10:20 UTC
On second taught, we can handle this on the UI side as well. But it will be a bit difficult to map all the types and make them work in a transparent way. For example in beagle-search it is possible to do this like:

AddSupportedFlavor (new HitFlavor (null, "File", "message/rfc822"));

Adding this to the mail tile will make it handle the file like a mail message and it will appear in the mail message group.
Comment 17 Debajyoti Bera 2006-01-16 15:04:29 UTC
Yes. That would enable filtering. But that has few shortcomings:

1) The effort needs to duplicated in all frontends.
2) The type is an information - best known by the Filter that filtered this file, and not storing this is not storing some information. Beagle is supposed to squeeze any juicy information available.
3) Querying by type: putting type=audio or type:audio (some fixed syntax) should only return results of type audio. This can be emulated in the frontend, but given that daemon returns only first 100 results, there are cases where frontend filtering will miss _the_one_ file that I seek.

Implementation proposal: One approach is this. Let the filters handle filetypes . Filter.cs by default will add a filetype of "File" or "Document" (default filetype) to each indexable. 
Backends/derived Filters will have the opportunity to override the filetype. If multiple filetypes needs to be supported (cant think of any example), then little more care is needed.
Comment 18 Lukas Lipka 2006-01-16 15:11:02 UTC
Yes, that's the most likely approach. It would also simplify many stuff in the frontends.
Comment 19 Debajyoti Bera 2007-01-13 20:17:05 UTC
I believe beagle-search already categorizes by type and not by backend. Implementing comment#11 would make the implementation easier but as far as the bug is concerned, its not present in beagle-search.