Re: Gloda search skips subfolders on some accounts

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Gloda search skips subfolders on some accounts

Andrew Sutherland-3
On 08/06/2012 02:12 AM, alehro wrote:
> I have account [hidden email]. Under this account I have folder folder1 with subfolder subfolder1. (So, the hierarchy is [hidden email]->folder1->subfolder1)
> The code:

There are a few possibilities:

- gloda failed to index the message because there is something about the
message that causes an indexing failure.

- gloda has been told not to index the folder.  Bring up folder
properties and make sure "Include messages in this folder in Global
Search results" is checked.

- Maybe you confused gloda by manipulating folders while Thunderbird was
offline or by moving an older global-messages-db.sqlite over the current
one, etc.

For debugging:

- Check out GlodaQuilla, you can add a "gloda id" column to the thread
pane, and see what the gloda id for a message is.  If the id is less
than 32, (20 in hex), gloda has marked the message bad because of an
indexing failure.

- If there is an indexing failure, turn on logging as noted on
https://wiki.mozilla.org/Thunderbird:Debugging_Gloda to enable logging
to see what gloda says when it tries to index the message.

- You can try and force gloda to reindex a message by toggling tags on
it or starring/unstarring it, marking it read/unread, etc.  You can also
copy the message to another (or the same folder) to trigger indexing and
possibly help eliminate there being a specific problem with the folder.

Andrew
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Gloda search skips subfolders on some accounts

Andrew Sutherland-3
On 08/06/2012 10:45 AM, Andrew Sutherland wrote:
> - Check out GlodaQuilla, you can add a "gloda id" column to the thread
> pane, and see what the gloda id for a message is.  If the id is less
> than 32, (20 in hex), gloda has marked the message bad because of an
> indexing failure.

Forgot to paste the link:
https://addons.mozilla.org/en-us/thunderbird/addon/glodaquilla-search-indexing-en/

Andrew
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Gloda search skips subfolders on some accounts

alehro
In reply to this post by Andrew Sutherland-3
On Monday, August 6, 2012 9:45:39 PM UTC+4, [hidden email] wrote:
> There are a few possibilities:
>

Hi Andrew,
Thank you for the explanation, but you do not take into consideration second part of my message:

> If I do search through the 'Edit->Find->Search Messages...' the result is non empty, i.e. it's fine.
> If I move the message to folder1, the code also gives correct result.

> The same bug is for query.tags('my_custom_tag') searches. But for built-in tag searches like query.tags('Work') all works fine.

> For my gmail.com accounts the bug is not reproducible.

It looks, if I used exactly the same code which is called from the 'Edit->Find->Search Messages...' the problem would gone. May be I missed some tricky flag or so. Unfortunately I cannot locate this code in the TB sources. Could you please help? If it's possible at all. I don't know, may be the code so scattered that it's impossible to collect.
I'm poking around searchSpec.js and nsMsgSearchSession.cpp, but it looks like wrong way, there is no evidence of calls to gloda database.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Gloda search skips subfolders on some accounts

Andrew Sutherland-3
On 08/07/2012 02:41 AM, alehro wrote:
> Thank you for the explanation, but you do not take into consideration second part of my message:
>
>> If I do search through the 'Edit->Find->Search Messages...' the result is non empty, i.e. it's fine.
>> If I move the message to folder1, the code also gives correct result.

This search does not use the global database, which is why it works.  If
your goal is to sanity-check your coded gloda queries against the
built-in gloda UI, you want to search by using the "Search" box
accessible via control-K.  Or choose "Other Actions | Open in
Conversation" from the message reader.


I definitely did miss the bit where you do query.tags('my_custom_tag').
  You need to pass an nsIMsgTag instance to the query, not a string.  I
don't think 'Work' should work either, so maybe that was just example
pseudocode you were using?

You can gain access to the tags instances by using the nsIMsgTagService.
  It's probably also okay to import and use the Gloda TagNoun helper.

http://mxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgTagService.idl#39
http://mxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules/noun_tag.js


> It looks, if I used exactly the same code which is called from the 'Edit->Find->Search Messages...' the problem would gone. May be I missed some tricky flag or so. Unfortunately I cannot locate this code in the TB sources. Could you please help? If it's possible at all. I don't know, may be the code so scattered that it's impossible to collect.
> I'm poking around searchSpec.js and nsMsgSearchSession.cpp, but it looks like wrong way, there is no evidence of calls to gloda database.

Your analysis is indeed correct as per the above.

You can use the non-gloda search mechanism to find messages, but it will
be less performant because the way it works is to open the .msf files
for the folders in succession and then check every header for the test
conditions.  While the header checks are fast because the database is in
memory, the folder loads can take a while.

Andrew
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird