Next: , Previous: , Up: Configuration   [Contents][Index]


4.3.13 Strategies and Default Searches

A default search is a MATCH request with ‘*’ or ‘!’ as the database argument (see The MATCH Command). The former means search in all available databases, the latter means search in all databases until a match is found.

Default searches may be quite expensive and may cause considerable strain on the server. For example, the command MATCH * priefix "" returns all entries from all available databases, which would consume a lot of resources both on the server and on the client side.

To minimize harmful effects from such potentially dangerous requests, it is possible to limit the use of certain strategies in default searches.

Configuration: strategy name { statements }

Restricts the use of the strategy name in default searches.

The statements define conditions the 4th argument of a MATCH command must match in order to deny the request. The following statements are defined:

Configuration: deny-all bool

Unconditionally deny the use of this strategy in default searches.

Configuration: deny-word list

Deny this strategy if the search word matches one of the words from list.

Configuration: deny-length-lt number

Deny if length of the search word is less than number.

Configuration: deny-length-le number

Deny if length of the search word is less than or equal to number.

Configuration: deny-length-gt number

Deny if length of the search word is greater than number.

Configuration: deny-length-ge number

Deny if length of the search word is greater than or equal to number.

Configuration: deny-length-eq number

Deny if length of the search word is equal to number.

Configuration: deny-length-ne number

Deny if length of the search word is not equal to number.

For example, the following statement denies the use of ‘prefix’ strategy in default searches if its argument is an empty string:

strategy prefix {
  deny-length-eq 0;
}

If the dicod daemon is configured this way, it will always return a ‘552’ reply on commands MATCH * prefix "" or MATCH ! prefix "". However, the use of empty prefix on a concrete database, as in MATCH eng-deu prefix "", will still be allowed.


Next: Tuning, Previous: Databases, Up: Configuration   [Contents][Index]