Difference between revisions of "Search regexp"

From AMule Project FAQ
Jump to: navigation, search
Line 1: Line 1:
== Description ==
+
related::<md4hash>
  
aMule uses three ports to transfer data with other clients and servers
+
So someone could try to search something like
*[[Standard cleint TCP port]]
+
*[[Extended client UDP port]]
+
*[[Extended server requests UDP port]]
+
  
The ideal is that all three ports are accessible, however:
+
related::<md4hash> AND Video AND SIZE > 1000000
*For the ED2K network, you will still be able to connect even if none of this are accessible. But
+
**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.
+
The server checks if the file is known.
  
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
+
If not -> End of request, 0 result.
  
== Determining which ports to forward ==
+
If yes : It scans the list of clients that share this file.
  
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.
+
A temporary 'working set' is inited to empty.
  
As said before, it is recommended to make all three ports acessible (even if not all are required).
+
For each client in the list, it scans the list of its shares, adding found file in a working set :
  
== Makeing ports accessible ==
+
If the file has a small #availability (like 1 : only one people share it), ignore it.
  
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].
+
If the file (md4 hash) is already in the working set, adds 1 to the 'related count'
  
So what does "not accessible" mean? It mans that:
+
If not, check if the file meets the search criteria (if any was specified in the search req)
*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]].
+
If the file meets the criteria, adds it to the working set with the 'related count' set to 1.
  
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:
+
Some logic could be added to make sure the working set could not use too much ram (if a threshold is hit, just do a garbage collection to free half of the entries for example)
#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).
+
Then sort the working set byt the 'related count' key, and give the 300 files having the highers 'related count'. We then free the working set (no 'more' request could be asked to the server to get next 300 files, because keeping the working set in memory would be too expensive)
  
== Notes ==
+
---
  
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, ...
+
Searches for multiple file extensions, support not<space> or !<no_space> operator too in file extension (like "zip,rar,cbz,cbr" or "!wme,!wma" or "not wme")
 +
 
 +
---
 +
 
 +
Ability to perform exact searches : Clients can enclose words in ' . Examples : 'blank & john' OR 'the the'
 +
 
 +
---
 +
 
 +
Double-quotes can be used to interpret ( ) (brackets) as normal characters instad of boolean modifyiers
 +
 
 +
---
 +
 
 +
words separators: , ; . : - _ ' / !
 +
 
 +
---
 +
 
 +
and & or not
 +
 
 +
---
 +
 
 +
Support for searches by files hashes. It accepts several links (ed2k://|file|name|size|Hash (anything after the hash will be ignored)), (ed2k:size:Hash), (magnet:?xt=ed2k:Hash), ...
 +
 
 +
ed2k::<md4hash> or ed2k:<size>:<md4hash>
 +
 
 +
---
 +
 
 +
The letter ñ is an alias to n letter in searches. A search of 'espana' know matches 'españa'

Revision as of 00:35, 15 December 2005

related::<md4hash>

So someone could try to search something like

related::<md4hash> AND Video AND SIZE > 1000000

The server checks if the file is known.

If not -> End of request, 0 result.

If yes : It scans the list of clients that share this file.

A temporary 'working set' is inited to empty.

For each client in the list, it scans the list of its shares, adding found file in a working set :

If the file has a small #availability (like 1 : only one people share it), ignore it.

If the file (md4 hash) is already in the working set, adds 1 to the 'related count'

If not, check if the file meets the search criteria (if any was specified in the search req)

If the file meets the criteria, adds it to the working set with the 'related count' set to 1.

Some logic could be added to make sure the working set could not use too much ram (if a threshold is hit, just do a garbage collection to free half of the entries for example)

Then sort the working set byt the 'related count' key, and give the 300 files having the highers 'related count'. We then free the working set (no 'more' request could be asked to the server to get next 300 files, because keeping the working set in memory would be too expensive)

---

Searches for multiple file extensions, support not<space> or !<no_space> operator too in file extension (like "zip,rar,cbz,cbr" or "!wme,!wma" or "not wme")

---

Ability to perform exact searches : Clients can enclose words in ' . Examples : 'blank & john' OR 'the the'

---

Double-quotes can be used to interpret ( ) (brackets) as normal characters instad of boolean modifyiers

---

words separators: , ; . : - _ ' / !

---

and & or not

---

Support for searches by files hashes. It accepts several links (ed2k://|file|name|size|Hash (anything after the hash will be ignored)), (ed2k:size:Hash), (magnet:?xt=ed2k:Hash), ...

ed2k::<md4hash> or ed2k:<size>:<md4hash>

---

The letter ñ is an alias to n letter in searches. A search of 'espana' know matches 'españa'