SourceForge Logo

Go to the SourceForge project home page








Query features

Go to documentation index

Table of contents

A. Search and answer filtering

Users can request complex queries via the query language.
All answers to a query are placed in a new panel.
There are NO limitations on the number of answers to a request.
To seek what you want in a list of answer, you can type in a filter (that's it: a query on the results of a query).


On the image, a request has been sent looking for files or directories named with the word "beatles" but not the word "submarine".
Then a filter has been set to ask only files matching the words "mono" and either "penny" or "strawberry".

B. Query language

B.1. Overview

The request syntax used in HeavyMole is probably the most complex one ever used in a P2P application. The syntax is even much more complex than the one used on search engines like Google.

The search is based on the file names. When you request a simple word, it will match with all files or directories containing this word. Capital letters have no influence.

You can compose more than one word with logical operators, allowing complex queries:

  • AND: you can use following symbols: "and", "&" or "+"
  • OR: you can use following symbols: "or", "|" or ","
  • SUB: you can use following symbols: "sub", "/", "\" or "-"
If no operators are given, then AND is assumed.
The priority of the operators are: SUB > AND > OR. You can use brackets "(", ")", "[" and "]" to force the order to be choosen.

  • "mpeg, mpg, avi, mov" will match all videos found with these file types
  • "violent femmes -add" will find all files with violent femmes except "Add it up"
  • "placebo (black market, without you)" will find songs from last two Placebo's albums

B.2. More advanced features

  • Each key (in a request, not in a filter) may be followed by either a "*" character to indicate you want all keywords beginning with this key, or a "!" character to indicate you want only this exact keyword. If the key is not followed by "*" or "!", then "*" is assumed.
  • All OR-terms in a request must contain at least one key with 3 or more characters (non-including "*")
  • Filters have the same syntax as requests, except that keys can contain one or more wildcards "*" and "?". "*" matches any number of characters or digits (including nothing); "?" matches exactly one character or digit
Here is the formal syntax of the language:
  • KEYWORD -> [a-z;A-Z;0-9]
  • OP -> OR_OP | AND_OP | SUB_OP
  • OR_OP -> 'or' | 'OR' | '|' | ','
  • AND_OP -> 'and' | 'AND' | '&' | '+'
  • SUB_OP -> 'sub' | 'SUB' | '/' | '\' | '-' - This page was last updated on july, 31th 2003