GithubHelp home page GithubHelp logo

n-connect / expression-search-ng Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opto/expression-search-ng

0.0 0.0 0.0 140 KB

update of Thunderbird addon ExpressionSearch/Gmail UI for TB 78 and later

expression-search-ng's Introduction

                                                                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expression Search / GMailUI is an extension to Thunderbird (versions 31.0+) which adds powerful message searching features. Init by Ken Mixter, developed over many years by Opera Wang, updated to TB 78+ by Klaus Buecher/opto.

Type "hello world" to search within the current view for this string in subject/from/to/cc.
Type "from:fred to:tom attachment:yes" or "f:fred t:tom att:yes" to see all messages from Fred to Tom in the current view that have an attachment.
Type "s:bbb t:(oo -pp)" to see all messages with subject bbb, send to oo but not to pp. Press Ctrl+Enter to have this search apply to all folders through virtual folder.
Press Shift+Enter to invoke Gloda Search in all indexed folders.
Use Ctrl/Shift+Right Click to search the clicked subject/From/Recipient.

Expression Search's features are described below.

The transfer to TB 78 is underway. Some features may not work yet. You can report issues at the home page for TB78: expression-search-NG

It is gratefully appreciated if you can support the transfer to TB 78 by a donation.

Search expressions and quick search key

This extension adds a new search text box to the end of your quick search bar. Whatever phrase you enter is searched for in your currently selected folder's to/from/cc/subject fields. Notice that by default the body is not searched for your search phrase. If that results in too many matches,you can focus the search using "operators". Operators are just short words followed by a colon, such as "from:amazon.com".

Here are some examples:

  1. weekend plans

    This expression searches all messages in the current folder or view for 'weekend plans' in the from, to, cc, or subject fields.

    If "Act as normal filter" enabled, the "Sender", "Recipients", "Subject" and "Body" buttons will determine to search in which fields.

  2. from:mike or f:mike

    This expression searches all messages in the current folder or view for 'mike' in the from field.

  3. to:bill or t:bill

    This expression searches all messages in the current folder or view for 'bill' in the to or cc fields of the message.

  4. tonocc:bill or cc:tom or bcc:riddle

    Like above, tonocc will search to field only, cc/bcc will search cc/bcc field only. Case insensitive.

  5. only:tom or o:tom

    Search for 'tom', and 'tom' should be the only recipients in to filed. Case insensitive.
    Note: 'only:(tom or jerry)' will get message that to filed is 'tom' or 'jerry' only, while 'only:(tom and jerry)' will get nothing, please use 'only:(tom,jerry)' instead if you want to search emails that recipients contain and only contain both 'tom' and 'jerry'.

  6. fromto:tom or ft:tom

    Search for 'tom', and 'tom' can be in either from, to, cc, or bcc. Case insensitive.

  7. subject:electric bill or s:electric bill

    This expression searches all messages in the current folder or view for 'electric bill' in the subject fields of the message. Case insensitive.

  8. simple:this subject contains special characters like ( ) ' " - etc

    This expression searches all messages in the current folder or view in the subject fields of the message. And the pattern can contain special characters. unlike "subject" search, this search won't suffer from Bug 124641.

    This pattern must be the last pattern. Case sensitive.

  9. regex:/^begin/i or re:end$ or r:/\d+\s*\d+/

    This expression searches all messages in the current folder or view with Regular Expressions in the subject fields of the message.

    This pattern must be the last pattern. Case sensitive unless you have //i.

  10. headerre:List-Id=/all-test/i or h:list-id or h:sender=/^Bob/ or hr:header~/^value/

    This expression searches all messages in the current folder or view with Regular Expressions in the header of the message. The header should be already saved in Thunderbird's .msf database. You can config the headers in 'options/Search More Headers', If you added one header, it will only affect newly added emails unless you do 'repaire folder'.

    This pattern must be the last pattern. Header is case insensitive, Value is case sensitive unless you have //i. If the value is empty, Any message has the header will match.

  11. fromre:/^begin/i or fr:end$

    This expression searches all messages in the current folder or view with Regular Expressions in the from fields of the message.

    This pattern must be the last pattern. Case sensitive unless you have //i.

  12. tore:/^begin/i or tr:end$

    This expression searches all messages in the current folder or view with Regular Expressions in the recipients(to/cc/bcc) fields of the message.

    This pattern must be the last pattern. Case sensitive unless you have //i.

  13. attachment:yes or a:yes

    This expression searches all messages in the current folder or view for an attachment, Notice that it does not search for attachments named "yes". You can also use "y" or "1" for "yes". You can use "no", "n", or "0" to search for messages without attachments.

  14. filename:foo.doc or fi:image or fn:msword or file:html

    This expression searches all messages in the current folder or view for an attachment name or type. Case insensitive. If you just want to search messages that have attachment, use attachment:yes instead of using this one.

  15. is:replied or i:UnRead or status:Forwarded or status:F

    This expression searches all messages in the current folder or view for status, The status can be one of Replied, Read, Marked/Star, Forwarded, UnRead, New, ImapDeleted or Attachment.

  16. before:2011/03/09 07:12:00 or be:09 Mar 2011 05:00:00 or after:Mar 10, 2011 or af:(2011/03/01 -2011/03/09)

    This expression searches all messages in the current folder or view within the date range, The date format can be checked Here.

  17. before:07:12:00 or be:5:9 or after:03:07:05 or af:(3:0 -4:0)

    This expression searches all messages in the current folder or view within the time range. af:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day.

  18. date:2011/01 or date:2011/01/03 or d:" 03:" or in zh-CN locale d:2011?3?

    This expression searches all messages in the current folder or view to match date. The internal format for compare is "yyyy/mm/dd hh:mm:ss", locale date is also supported.

  19. ag:3 or da:3 or age:3 or older_than:3 or days:(3 -5) or age:today or newer_than:8week

    This expression searches all messages in the current folder or view to match age in days. days:(3 -5) will search for messages that age between 3 to 5 days.

  20. size:10 or si:(0.5M -2M) or larger:1G or smaller:1024 or sm:10

    This expression searches all messages in the current folder or view to match size in KB or MB/GB. size:(3 -5) will search for messages that size is larger than 3KB and less than 5KB, that is 4.x KB.

  21. body:electric bill

    This expression searches all messages in the current folder or view for 'electric bill' in the body of the message. On large or remote folders it may take some time. Also, if you combine this with other search operators like "from:", "subject:" or "to:" this will speed things up considerably.

  22. bodyre:/hello.*world/i or br:test

    This expression searches the body of all messages in the current folder or view with Regular Expressions. Case sensitive and should be the last pattern. Only search offline messages.

  23. label:Important or tag:TODO or l:NA

    This expression searches all messages in the current folder or view which has the tag Important. l:NA means all messages without tag.

  24. all: weekend plans

    This expression searches all messages in the current folder or view for 'weekend plans' anywhere in the message, including the from, to, cc, or subject fields, and the body.

  25. g: weather

    This will call gloda (faceted) search if gloda enabled. This mode can't be used together will other specifications like 'f:' or 't:'.

  26. 3+2

    If the expression looks like an arithmetic one, when you press enter, it will be calculated and the result will be shown in the search box.

  27. from:-foo from:-bar [...]

    So-called Inverted Search. This is a not x and not y [...] search for the selected attribute (Here: from:).
    This is the GMail search-equivalent of: -foo -bar.

Hot Key

By default, Press Ctrl+Shift+K, your cursor will appear in the expression search bar and you will be able to type.

Expression Search add one additional hot key "Ctrl+B".

Once you are typing in your search query, and you hit enter or otherwise let it begin searching, your cursor will remain inside of the query box to allow you to modify the query. However, if you'd rather go back to browsing your messages, instead of clicking on the message headers in your search results, you can just press 'ESC' to to clear the search criteria, and press 'ESC' again to refocus back

Quick Search Virtual Folder

If you haven't before used 'virtual folders' in Thunderbird, let me introduce them. This standard feature of Thunderbird lets you create a search, name it, and then have that name appear in your folders list. You can select that folder from the list and see the current result of the saved search. Note two useful things: 1) the 'contents' of the virtual folder can actually be in any of your real folders, and so a virtual folder actually can 'contain' messages that span many folders, and 2) the virtual folder's contents are recomputed each time you view it, so if you saved a virtual folder with 'sender' field containing 'Donald', then if you receive a new message from someone named Donald, it will be placed in your INBOX, but you'll immediately be able to switch to your Donald virtual folder, and find it there.

So that's what regular virtual search folders do in Thunderbird. But this extension makes it extremely easy to create them. Now, when you normally hit 'enter' in the Expression search quick search bar, you can instead hit 'ctrl-enter' and a virtual folder called 'ExressionSearch' will be created (or modified if it already existed) to search for that search across ALL of your folders in the current account.

The resulting virtual folder 'ExpressionSearch' can then be modified by editing properties, or can be renamed to make it a permanent virtual search folder. If you do not rename the folder, the next time you use ctrl-enter the ExpressionSearch virtual folder is reused to show your new quick search result.

The option "Keep selected folders for saved search" to have the "ExpressionSearch" virtual folder being persistent not only allows you to mark it as "Preferred" without the setting being lost when restarting TB, but also you can edit the properties of the "ExpressionSearch" virtual folder to specify once for all which of your physical folders should be searched or not with a global non-faceted search (CTRL+Enter).

Where "ExpressionSearch" is created can also be set in the option dialog, By default, it's the root folder of the current disaplyed folder

You can back to original folder by press Ctrl+Alt+LEFT

More complex searching

The quick search bar allows you use the simple expressions from above, but it also allows you to compose more complex searches. For instance, if you want to search for a message from Bob Barker to Dave Letterman about monologues, you can use:

f:Bob Barker t:Dave Letterman s:monologues

If you are tired of getting results that have jokes about "Monica", you can instead use:

f:Bob Barker t:Dave Letterman s:monologues -Monica

If you are interested in messages from either of these celebrities:

f:Bob Barker or f:Dave Letterman

Notes

Note 1: For the average user, the above information is usually adequate. If you are curious, this feature still relies upon an underlying Thunderbird message searching mechanism. That mechanism cannot always perform searches correctly that have a combination of boolean operators. So, if you try to perform a search that mixes "ands" and "ors" you may get back too many results. As an example, if you were to search for "t:dan and f:(bob or dave)" you will be mixing boolean operators and the results may be over inclusive or may work. As an extra technical note, if you did "t:dan and -f:(bob or dave)", DeMorgan's theorem takes place and you are actually composing a search of "t:dan and f:-bob and f:-dave".

However, due to restrictions in Thunderbird's virtual search folder, the complex searching results maybe correct in your current search results, but maybe NOT in you search folder. as the search folder can only handle 'Match all' and 'Match any' types.

Note 2: If you want search all folders using expression, you can create a virtual folder manually (Ctrl+Shift+F) with 'Match all messages', then using expression search in the virtual folder.

Note 3: In case you also using the normal search filter, the final results is logically "AND", that means both filter are effective.

Click 2 Search

If Enabled, you can use Ctrl/Shift+Right Click on sender/recipient/subject column to search for the same sender, recipient or subject.

For subject line, if provided regular expression match/replace patterns and enabled the replace for corresponding key combo, the pattern will be first executed

Replace subject before search.
Multiple matches are ORed. Example:
    Match:   \[#(\d*)\]
    Replace: $1
    Subject: [#1212][#2323]Some text
    Result:  (1212 or 2323)

Also common prefix like 'Re:', 'Fw:', [mail-list-name] will be removed before search.

Version history

  • Version 2.4beta:
    • Works with TB78, drop support for old TB pre 78
  • Version 1.4:
    • Works with TB 63 nightly, drop support for TB older than 60
    • Change from legacy XUL overly addon to restartless addon
  • Version 1.3:
    • Works with TB 60 nightly, drop support for TB older than 52
    • Fixed issue with 'only' filter
  • Version 1.2:
    • Add 'fromto' token
    • Add option for search input box timeout
    • Fixed issue with OSX
    • Fixed issue with TB 55
  • Version 1.1:
    • Works with TB 56 nightly
  • Version 1.0:
    • Works with TB 45 nightly
  • Version 0.9:
    • Compatible with TB40 nightly and drop support for TB version less than 31
    • Attachment search is fully supported and won't crash TB any more, for offline messages only.
    • Add option to put the Expression Search field into the Tab bar
    • Add option to (not) remove the domain name for click2search
    • Add option to hide the quick search filter icons
    • Looks better on OSX and Ubuntu
  • Version 0.8.8:
    • Compatible with TB31 nightly and drop support for TB 5~11
    • regex search in body is fully supported and won't crash TB any more, for offline messages only.
  • Version 0.8.7:
    • Compatible with TB29 nightly
    • Added regex search for from/to
    • Added option to make the "search results" doesn't looks so big when search is not active
    • Changed hotkey from Ctrl+Left to Ctrl+Alt+Left for back to original folder after Ctrl+Enter
  • Version 0.8.6:
    • getCellProperties API change for TB22
    • Add options for tooltip show/hide time
    • change the flexibility of other element to make my search box bigger
    • Add "Re: " to subject if it's a reply email for subject regex search
    • Add 'Select All', 'Clear All' & select mode when modify virtual folder's folders.
    • Fix bug: Donate through palpay directly not working because I'm in China
  • Version 0.8.5:
    • Added options for show or hide text labels of 'quick filter' buttons
    • Added options to seperate subject replacment for Ctrl/Shift+RightClick
    • Added options for load Saved Search folder in a new Tab
    • Added hotkey Ctrl+Left for back to original folder after Ctrl+Enter
    • Added regex search for headers
    • Added regex search for body
    • Added newer_than/older_than support
    • Added size/larger/smaller support
    • Support NA for tag search, Star for status search
    • Added today/yesterday/day/month/year for days search
    • Added status bar icon & tips
    • Added donate buttons
    • Added scrollbar for option window when needed
    • Fixed crash issue when ctrl2search on headers
    • Fixed bugs for Ctrl+Enter launch gloda search when no messages found
    • Fixed bugs for pined quick search buttons not work when switch between folders
    • Fixed bugs for transparent background help page on Mac OS
    • Fixed bugs for click2search triggers context menu on Mac OS
    • Compatible with TB5~TB23
  • Version 0.8.4:
    • Added tonocc/bcc/cc/only/age search
    • Added options for show verbose information
    • Added options for where to create expression search folders
    • Fixed '<>' in search pattern issue when use click2search
    • Fixed search issue when use click2search and address is in address book
    • Fixed hang issue when '\t' exists in search pattern
    • Fixed minor bug that extension defined search terms show when search in address book
    • Fixed one bug that icons for quick search may missing when move search buttons to menubar or toolbar
  • Version 0.8.3: Fixed context menu missing issue when click right button.
  • Version 0.8.2: Work with Thunderbird 5. Fixed search bar shown issue. Fixed issue when search with complicated expressions.
  • Version 0.8.1: Fixed a bug: During search, 'Continue search with all folders' message will shown.
  • Version 0.8:
    • Work with Thunderbird 3.3.
    • Added Click2Search similar to The Bat!
    • Added options to move expression search box to toolbar/menubar
    • Added options to act as normal search box
    • Added options to select 1st messages after hit enter in search box
    • Hit enter will launch gloda search if no message found
    • Hit Ctrl+B will focus on search box
    • before/after search can now search time within day
    • Added simple/regex/date search
    • Added filename for attachment name/type search (experimental, may crash)
  • Version 0.7: Added 'status/is' search. Added 'before/after' search. Added numerical calculation.
  • Version 0.6: Added Help & Contact link to Options dialog.
  • Version 0.5: Added Options dialog.
  • Version 0.4: Work with Thunderbird 3.1 .
  • Version 0.3: Shift+Enter to launch gloda search. Fix 'Cc','Cu','Ci','Cr' redefine error.
  • Version 0.2: Added 'g:' search mode for gloda search. Press 'Esc' in thread tree will clear the search criteria.
  • Version 0.1: First version, changed from GMailUI to make it works for Thunderbird 3.

Known Issues of this extension or Thunderbird

  • Shift+RightClick May not work for some versions of Thunderbird.
  • Bug 224392 - Add ability to filter by attachment name (extension)
  • Bug 338761 - searching body of emails for text doesn't match word-wrapped text
  • Bug 460737 - Quickfilter ignores searches for friendly display names from address book contacts, as displayed on message header and message list by default (no or incomplete results for From, To, CC, BCC)
  • Bug 522886 - Implement "Recipients" column that shows all recipients (To, CC, and BCC)
  • Bug 546925 - custom header search is non-functional ('Run search on server' of Edit/Find/Search Messages doesn't work any more)
  • Bug 570815 - (qfwidget) Make Quickfilter optionally available as simple searchbox widget+stickypin (with filter criteria in persistent popup panel &/or dropdown; toolbar customization)
  • Bug 124641 - Thunderbird does not handle multi-line headers correctly when search term spans lines
  • Bug 363238 - saved searches fail for searches on x-headers
  • Bug 474730 - should search newest first - searching returns messages in bad order, making searches very time-consuming and irrelevant for large databases
  • Bug 564328 - Keyboard shortcut Ctrl+F conflict and cmd_find ambiguity, used for both Find in This Message and Quick Filter
  • Bug 600140 - 'Unread' quick filter hides some unread messages (the beginning of a thread)
  • Bug 607295 - Provide UI for new archive granularity and folder structure options
  • Bug 625472 - Quick search processes input after hiding it with escape

Compared with original GMailUI 0.6, these features are still missing:

  • Use 'Y' to archive selected mail to archive folder (use 'a')
  • Use J/K to move messages up and down, and Ctrl+J to mark a message as junk (conflict with builtin key mapping, use 'f/b' instead)
  • Key '/' focuses on the quick search bar (use Ctrl+F)
If you do need to change the hotkeys, please try other extensions below.

Other Extensions

You can try the following extensions to make your Thunderbird more convenient.

Thanks

  • Ken Mixter - Original Author of GMailUI
  • Opera Wang 15 years of developing Expression Search/GmailUI
  • savo_msu - Author of One Click Search
  • Kent James - Author of FiltaQuilla
  • Jiten Dedhia - Suggest for 'toonly' search
  • Jonathan Kamens - Patch for TB56 support
  • Greg Cowan - Suggest for date search
  • Mike Martinez - Suggest for bcc search
  • Olivier - Suggest for Shift/Ctrl+Enter
  • Paul Sednaoui - Suggest for 'only' search
  • Randolf Ebelt - Find a bug when search with complicate expressions
  • Olivier Brodeur - Find a bug when no messages found, gloda launched when Ctrl+Enter
  • Lee Yeoh - Find a bug for pined quick search buttons not work
  • Tom Zhu - Suggest for Enter to focus message pane, and validations before release.

Feedback, Suggestions, and on-going Development

Klaus Buecher/Opto's Home Page for TB 78+: expression-search-NG

Opera Wang's Home Page (TB 60): expression-search, not in active development

Ken Mixters Home Page: GMailUI, pre 2005

ย 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.