Difference between revisions of "Search regexp"

From AMule Project FAQ
Jump to: navigation, search
m (Removed Version Tag)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Description ==
 
== Description ==
 +
This article explains how to tweak [[search]]es and some handy tips and tricks when searching with [[aMule]].
  
aMule uses three ports to transfer data with other clients and servers
+
Notice that this tricks may not work for you at some moments, since it depends on the [[server]]'s running software. However, most [[ED2k|ed2k]] servers run the latest version of [[lugdunum]], so this tricks will work for 99% of your servers.
*[[Standard cleint TCP port]]
+
*[[Extended client UDP port]]
+
*[[Extended server requests UDP port]]
+
  
The ideal is that all three ports are accessible, however:
+
== First notes ==
*For the ED2K network, you will still be able to connect even if none of this are accessible. But
+
Searches always search for all the words in the query and are case-insensitive.
**LowID: If the Standard client TCP port is not accessible, you will get a [[Low ID]] and suffer from severe transfer speeds decrease
+
**High ID: Only the Standard client TCP port is required to be accessible to get a [[High ID]]. With High ID you will get the highest transfer speeds the ED2K network can provide you
+
*For the Kademlia network, '''both''' the standard client TCP port and th Extende client TCP port '''must''' be accessible. If they aren't, you will not be able to connect to the Kademlia network
+
  
It is highly recommended to make the Extended server requests UDP port accessible too, since it will provide you with very useful statistics and information about files on the ed2k network.
+
== Boolean search ==
 +
Since aMule 2.1.0 boolean search is supported. This allows fine tweaked searching queries.
  
Similarly, the Extended client UDP port on the ED2K netork, though not required, when accessible it will provide you with highly useful statistics and information about other clients and files, so it is also highly recommended
+
The following operators are available:
  
== Determining which ports to forward ==
+
{|+ Operators
 +
| '''''Operator''''' || '''Meaning'''
 +
|-
 +
| ''AND'' || Both the query before and after the operator must match
 +
|-
 +
| ''OR'' || Either the query before or after the operator must match
 +
|-
 +
| ''NOT'' || The query after the operator must not match
 +
|}
  
Start aMule and open the [[Usage_Preferences|Preferences]] -> Connection window. See the '''Standard client TCP port''' box, the '''Extended client UDP port''' box and the number by the '''UDP port for extended server requests (TCP+3)'''. Those three are the ports aMule uses.
+
Instead of ''AND'' you can use ''&'' and instead of ''NOT'' you can use simply ''!'' ('''not''' followed by a space).
  
As said before, it is recommended to make all three ports acessible (even if not all are required).
+
Example: ''xfree OR xorg''
  
== Makeing ports accessible ==
+
Example: ''drivers AND linux''
  
You can check if a port is "accessible" (also known as "open") by visiting [http://www.amule.org/testport.php aMule's Test Port page].
+
Example: ''some_free_music AND NOT some_artist'' is equivalent to ''some_free_music & !some_artist''
  
So what does "not accessible" mean? It mans that:
+
So, when you introduce a search query, it is read and each word is understood either as an operator (when it is ''AND'', ''&'', ''OR'', ''NOT'' ou ''!'') or as a query.
*You are behind a router which is blocking incoming connections to your port
+
*You are behind a firewall (actually, when routers block ports it is because they are acting as a firewall) which is blocking some of your oprts:
+
**The firewall can be on your computer, for example, the ''iptables'' daemon
+
**The firewall can be somewhere outside your computer, probably some gateway through which you connect to the internet
+
  
If you have a firewall, then you should ask your administrator to open the ports there (or read the manual if you can access the firewall's configuration). There are too many firewalls to describe, however, check the [[Firewall|Firewall article]].
+
Example: ''aMule AND MacOS'' will search for files containing ''aMule'' and ''MacOS'' in their filename.
  
If you are behind a router ask your Aministrator to forward the ports to your computer (see above to know which ports to forward). However, if you have access to your router's configuration, you can do that yourslef:
+
If no operator is found between two words, it defaults to the ''AND'' operator.
#Disable DHCP in your computer (not in router!) to get a static IP address in the LAN. This is doen through the ''/etc/interfaces'' configuration file (see ''man interfaces'')
+
#In the router's configuration, forward the ports aMule should use toy your IP (you static IP in the LAN, as described above) and apply changes in the router (you might have to restart the router)
+
  
The router's configuration is usually available through http://192.168.1.1 from the webbrowser. The exact place where ports can be forwarded in your router's configuration system varies greatly from one router to another. And there are hundreds of different router models, so this can't be explained here. However, as a general rule, you should search for some section called "LAN configuration", "NAT configuration", "Firewall", "Ports" or "Security" (remember, this is just a general rule. Your router could be very different).
+
Notice that operators are case sensitive so, while ''AND'' is an operator, ''and'' is a word.
  
== Notes ==
+
Words are any characters between between any of the following characters:
  
No, there's no easier way. That's how port forwarding goes :) Same for [[eMule]], [[Shareaza]], [[lphant]], [[Napster]], [[Morpheus]], [[Kazaa]], [http://www.apache.org Apache], FTP Server, ...
+
{|+ Word separators
 +
| '''Character''' || '''''Description'''''
 +
|-
 +
| , || ''Comma''
 +
|-
 +
| ; || ''Semicolon''
 +
|-
 +
| . || ''Dot''
 +
|-
 +
| : || ''Colon''
 +
|-
 +
| - || ''Dash''
 +
|-
 +
| _ || ''Underscore''
 +
|-
 +
| ' || ''Apostrophe''
 +
|-
 +
| / || ''Slash''
 +
|-
 +
| ! || ''Bang''
 +
|-
 +
|  || ''Space''
 +
|}
 +
 
 +
Null words are ignored.
 +
 
 +
Example: ''aMule, MacOS'' is equivalent to ''aMule,MacOS'' which is equivalent to ''aMule AND MacOS''.
 +
 
 +
You can group words and operators in brackets, to make them into a single query with each its sub-queries.
 +
 
 +
Example: ''aMule & (MacOS OR Win)'' will search for al files containing ''aMule'' and either ''MacOS'' or ''Win'' it their filename.
 +
 
 +
Brackets must always be matched.
 +
 
 +
Example: ''aMule AND optionA)'' will fail since the closing bracket matches no opening bracket.
 +
 
 +
Example: ''aMule OR (linux'' will aslo fail since the opening bracket matches no closing bracket.
 +
 
 +
== Exact matches ==
 +
Exact matches are an extension of boolean searches.
 +
 
 +
You may want to search for a series of words together or some other string containing word separators in it. To do so, wrap that string with apostrophes.
 +
 
 +
Example: ''aMule and '2.1.0' '' searches for files containing ''aMule'' and ''2.1.0'' in their filename (notice that the dots are no longer being interpreted as word separators).
 +
 
 +
Example: ''aMule'2.1.0' '' is exactly equivalent as ''aMule and '2.1.0' '', since the apostrophe is still a word separator, so ''aMule'' will be one word and ''2.1.0'' another (and the default operator is ''AND'').
 +
 
 +
Still, apostrophes will not wrap brackets.
 +
 
 +
Example: ''aMule and 'distro (debian)' '' will fail because the aposotrophes appear to be opened but not closed, since there is a bracket (actually, two of them) in between.
 +
 
 +
The only way to wrap brackets so that they can be searches as part of a word is wrapping them in double quotes. Double quotes can also wrap apostrophes.
 +
 
 +
Example: ''"aMule's 2nd birthday (19-08-2005)"
 +
 
 +
Example: ''aMule"2.1.0" '' is exactly equivalent as ''aMule and "2.1.0" '', since the double quotes are still word separators, so ''aMule'' will be one word and ''2.1.0'' another (and the default operator is ''AND'').
 +
 
 +
== Search for file except for extension ... ==
 +
You can use the ''not <query>'' and ''!<query>'' boolean operators in the "extension" field in the [[Usage_Searches|search window]].
 +
 
 +
This way you can search for files not containing the given extension, which is often very useful.
 +
 
 +
== Find files similar or related to some other file ==
 +
In the search box enter ''related::<hash>'' where ''<hash>'' is the is the [[hash]] value of some [[file]]. The results you will get will be files which are related or similar to that file.
 +
 
 +
Actually, what the server does is read an index with all files all [[client]]s are sharing and see, out of those sharing the file with has value ''<hash>'', which are the most popular files. Low [[availability]] files aren't listed.
 +
 
 +
== Search for hashes or exact file ==
 +
If you want to search for any file which's has value is ''<hash>''' (where ''<hash>'' is any MD4 hash value), you can search for ''edk2:<hash>'' and you will get the results.
 +
 
 +
As an extension, if you want to search for an exact file (maybe you want to see its availability or its [[rate]]) and searching it by its hash value gives several non-equal files, you can narrow the results by searching by the file's hash value ''<hash>'' and size ''<size>'': ''ed2k:<size>:<hash>''
 +
 
 +
Or even simply the file's [[ed2k link]] (anything after the file's hash in the link will be ignored): ''ed2k://|file|<name>|<size>|<hash>
 +
 
 +
== The special 'Ñ' character ==
 +
Current server and client software support [[unicode]] so it is no more an issue, but older versions would not support non-english characters, such as the ''ñ'' spanish character.
 +
 
 +
As a solution, the ''ñ'' character was aliased to ''n''. So, searching for ''españa'' or ''espana'' would give the same results.
 +
 
 +
This aliasing applies also to unicode-supporting clients and servers. The only thing you should notice is that in this case, since ''ñ'' is a different character than ''n'' and unicoded recognizes it, searching for words containing ''n'' will display results containing ''ñ'', but not the other way round.
 +
 
 +
== Notes ==
 +
You can combine the above tricks, so someone could try to search something like ''related::<some_hash> AND Video AND SIZE > 1000000''

Latest revision as of 10:22, 29 June 2008

Description

This article explains how to tweak searches and some handy tips and tricks when searching with aMule.

Notice that this tricks may not work for you at some moments, since it depends on the server's running software. However, most ed2k servers run the latest version of lugdunum, so this tricks will work for 99% of your servers.

First notes

Searches always search for all the words in the query and are case-insensitive.

Boolean search

Since aMule 2.1.0 boolean search is supported. This allows fine tweaked searching queries.

The following operators are available:

Operator Meaning
AND Both the query before and after the operator must match
OR Either the query before or after the operator must match
NOT The query after the operator must not match

Instead of AND you can use & and instead of NOT you can use simply ! (not followed by a space).

Example: xfree OR xorg

Example: drivers AND linux

Example: some_free_music AND NOT some_artist is equivalent to some_free_music & !some_artist

So, when you introduce a search query, it is read and each word is understood either as an operator (when it is AND, &, OR, NOT ou !) or as a query.

Example: aMule AND MacOS will search for files containing aMule and MacOS in their filename.

If no operator is found between two words, it defaults to the AND operator.

Notice that operators are case sensitive so, while AND is an operator, and is a word.

Words are any characters between between any of the following characters:

Character Description
, Comma
 ; Semicolon
. Dot
 : Colon
- Dash
_ Underscore
' Apostrophe
/ Slash
 ! Bang
Space

Null words are ignored.

Example: aMule, MacOS is equivalent to aMule,MacOS which is equivalent to aMule AND MacOS.

You can group words and operators in brackets, to make them into a single query with each its sub-queries.

Example: aMule & (MacOS OR Win) will search for al files containing aMule and either MacOS or Win it their filename.

Brackets must always be matched.

Example: aMule AND optionA) will fail since the closing bracket matches no opening bracket.

Example: aMule OR (linux will aslo fail since the opening bracket matches no closing bracket.

Exact matches

Exact matches are an extension of boolean searches.

You may want to search for a series of words together or some other string containing word separators in it. To do so, wrap that string with apostrophes.

Example: aMule and '2.1.0' searches for files containing aMule and 2.1.0 in their filename (notice that the dots are no longer being interpreted as word separators).

Example: aMule'2.1.0' is exactly equivalent as aMule and '2.1.0' , since the apostrophe is still a word separator, so aMule will be one word and 2.1.0 another (and the default operator is AND).

Still, apostrophes will not wrap brackets.

Example: aMule and 'distro (debian)' will fail because the aposotrophes appear to be opened but not closed, since there is a bracket (actually, two of them) in between.

The only way to wrap brackets so that they can be searches as part of a word is wrapping them in double quotes. Double quotes can also wrap apostrophes.

Example: "aMule's 2nd birthday (19-08-2005)"

Example: aMule"2.1.0" is exactly equivalent as aMule and "2.1.0" , since the double quotes are still word separators, so aMule will be one word and 2.1.0 another (and the default operator is AND).

Search for file except for extension ...

You can use the not <query> and !<query> boolean operators in the "extension" field in the search window.

This way you can search for files not containing the given extension, which is often very useful.

Find files similar or related to some other file

In the search box enter related::<hash> where <hash> is the is the hash value of some file. The results you will get will be files which are related or similar to that file.

Actually, what the server does is read an index with all files all clients are sharing and see, out of those sharing the file with has value <hash>, which are the most popular files. Low availability files aren't listed.

Search for hashes or exact file

If you want to search for any file which's has value is <hash>' (where <hash> is any MD4 hash value), you can search for edk2:<hash> and you will get the results.

As an extension, if you want to search for an exact file (maybe you want to see its availability or its rate) and searching it by its hash value gives several non-equal files, you can narrow the results by searching by the file's hash value <hash> and size <size>: ed2k:<size>:<hash>

Or even simply the file's ed2k link (anything after the file's hash in the link will be ignored): ed2k://|file|<name>|<size>|<hash>

The special 'Ñ' character

Current server and client software support unicode so it is no more an issue, but older versions would not support non-english characters, such as the ñ spanish character.

As a solution, the ñ character was aliased to n. So, searching for españa or espana would give the same results.

This aliasing applies also to unicode-supporting clients and servers. The only thing you should notice is that in this case, since ñ is a different character than n and unicoded recognizes it, searching for words containing n will display results containing ñ, but not the other way round.

Notes

You can combine the above tricks, so someone could try to search something like related::<some_hash> AND Video AND SIZE > 1000000