org.carrot2.source
Enum MultipageSearchEngine.SearchMode

java.lang.Object
  extended by java.lang.Enum<MultipageSearchEngine.SearchMode>
      extended by org.carrot2.source.MultipageSearchEngine.SearchMode
All Implemented Interfaces:
Serializable, Comparable<MultipageSearchEngine.SearchMode>
Enclosing class:
MultipageSearchEngine

public static enum MultipageSearchEngine.SearchMode
extends Enum<MultipageSearchEngine.SearchMode>

Search mode for data source components that implement parallel request to some search service.


Enum Constant Summary
CONSERVATIVE
          In this mode, an initial search request is performed to estimate the number of documents available on the server.
SPECULATIVE
          In this mode, the number of requested documents is divided by the maximum number of documents the search engine can return in a single request.
 
Method Summary
static MultipageSearchEngine.SearchMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MultipageSearchEngine.SearchMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CONSERVATIVE

public static final MultipageSearchEngine.SearchMode CONSERVATIVE
In this mode, an initial search request is performed to estimate the number of documents available on the server. Then the requested number of documents is adjusted according to the number of documents available to minimize the number of requests.


SPECULATIVE

public static final MultipageSearchEngine.SearchMode SPECULATIVE
In this mode, the number of requested documents is divided by the maximum number of documents the search engine can return in a single request. The result is the number of concurrent requests launched to the search service.

Note that speculative threads cause larger load on the search service and will exhaust your request pool quicker (if it is limited).

Method Detail

values

public static MultipageSearchEngine.SearchMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MultipageSearchEngine.SearchMode c : MultipageSearchEngine.SearchMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MultipageSearchEngine.SearchMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright (c) Dawid Weiss, Stanislaw Osinski