Public Member Functions | |
void | close () |
boolean | contains (String key) |
Postlist.Head | getHead (String key) |
Properties | getProperties () |
Postlist< V > | search (String key) |
Postlist< V > | search (String key, int num) |
Postlist< V > | search (String key, int begin, int num) |
Static Public Member Functions | |
static< VextendsValue > Searcher< V > | open (Class< V > clazz, Configuration config) |
Protected Member Functions | |
void | finalize () throws Throwable |
Static Package Functions | |
[static initializer] | |
Private Member Functions | |
Searcher (Pointer nativeSearcher, Class< V > clazz, Properties props) | |
native void | searcher_close (Pointer raw_searcher) |
native boolean | searcher_search_head (Pointer raw_searcher, String key, Postlist.Head head) |
native Pointer | searcher_search_postlist (Pointer raw_searcher, String key, int begin, int num, Postlist.Head header) |
Static Private Member Functions | |
static native Pointer | searcher_open (int type_id, ConfigurationImpl config, PropertiesImpl props) |
Private Attributes | |
Pointer | nativeSearcher |
Properties | props |
Class< V > | clazz |
A class to search an inverted index instance.
Definition at line 20 of file Searcher.java.
de::aitools::aq::invertedindex::core::Searcher< V extends Value >::Searcher | ( | Pointer | nativeSearcher, | |
Class< V > | clazz, | |||
Properties | props | |||
) | [inline, private] |
Initializes this searcher instance with a JNA Pointer, that references the native equivalent, the class object of the index' value type, and the index' properties.
Definition at line 58 of file Searcher.java.
de::aitools::aq::invertedindex::core::Searcher< V extends Value >::[static initializer] | ( | ) | [inline, static, package] |
void de::aitools::aq::invertedindex::core::Searcher< V extends Value >::close | ( | ) | [inline] |
Closes the searcher. Call this method in some cleanup code to cleanly shutdown and to delete the native searcher. The searcher is then not usable anymore.
Definition at line 70 of file Searcher.java.
boolean de::aitools::aq::invertedindex::core::Searcher< V extends Value >::contains | ( | String | key | ) | [inline] |
Convenience method to check, if the index contains some mapping for the given key. Do not use this method, if you are going to lookup the Postlist, if such a mapping exists. For that reasons try to directly search the postlist and skip if empty.
key | the key to check for, if some mapping exist |
Definition at line 89 of file Searcher.java.
void de::aitools::aq::invertedindex::core::Searcher< V extends Value >::finalize | ( | ) | throws Throwable [inline, protected] |
Definition at line 94 of file Searcher.java.
Postlist.Head de::aitools::aq::invertedindex::core::Searcher< V extends Value >::getHead | ( | String | key | ) | [inline] |
Convenience method to search the Head of some Postlist if only interested in that meta-data. Do not use this method, if you are going to lookup the entire postlist afterwards. For that reasons try to directly search the postlist and skip if empty.
key | the key of the postlist to lookup the head for |
null
Definition at line 112 of file Searcher.java.
Properties de::aitools::aq::invertedindex::core::Searcher< V extends Value >::getProperties | ( | ) | [inline] |
Returns the Properties of the underlying index.
Definition at line 125 of file Searcher.java.
static <VextendsValue> Searcher<V> de::aitools::aq::invertedindex::core::Searcher< V extends Value >::open | ( | Class< V > | clazz, | |
Configuration | config | |||
) | [inline, static] |
Opens and returns an index instance located in Configuration#getIndexDirectory(). The instantiation of the native equivalent will fail, if the the given class of the index' value type does not match the type of the index on disk.
<V> | the value type, which is some derivative of Value. | |
clazz | the class object of the index' value type | |
config | the configuration of the index to load. Only parameters Configuration#getIndexDirectory() and Configuration#getMaxMemoryUsage() will be evaluated. |
Definition at line 42 of file Searcher.java.
References de::aitools::aq::invertedindex::core::Properties::impl, and de::aitools::aq::invertedindex::core::Configuration::impl.
Postlist<V> de::aitools::aq::invertedindex::core::Searcher< V extends Value >::search | ( | String | key, | |
int | begin, | |||
int | num | |||
) | [inline] |
Returns a iterable Postlist for the given key. The postlist will be loaded from the index specified by begin with at most the num following elements from that position. The corresponding range is [begin, begin + num). If begin is not a valid index the returned postlist will be empty.
key | the key to search the inverted index for | |
begin | the index of the first postlist element to load | |
num | the maximal number of postlist elements to load |
null
Definition at line 174 of file Searcher.java.
Postlist<V> de::aitools::aq::invertedindex::core::Searcher< V extends Value >::search | ( | String | key, | |
int | num | |||
) | [inline] |
Returns a iterable Postlist for the given key. The postlist will be truncated at the end to contain at most the first num elements. The corresponding range is [0, num). Use this method to efficiently lookup the wanted top-k entries.
key | the key to search the inverted index for | |
num | the maximal number of postlist elements to load |
null
Definition at line 155 of file Searcher.java.
Postlist<V> de::aitools::aq::invertedindex::core::Searcher< V extends Value >::search | ( | String | key | ) | [inline] |
Returns a iterable Postlist for the given key.
key | the key to search the inverted index for |
null
Definition at line 138 of file Searcher.java.
native void de::aitools::aq::invertedindex::core::Searcher< V extends Value >::searcher_close | ( | Pointer | raw_searcher | ) | [private] |
static native Pointer de::aitools::aq::invertedindex::core::Searcher< V extends Value >::searcher_open | ( | int | type_id, | |
ConfigurationImpl | config, | |||
PropertiesImpl | props | |||
) | [static, private] |
native boolean de::aitools::aq::invertedindex::core::Searcher< V extends Value >::searcher_search_head | ( | Pointer | raw_searcher, | |
String | key, | |||
Postlist.Head | head | |||
) | [private] |
native Pointer de::aitools::aq::invertedindex::core::Searcher< V extends Value >::searcher_search_postlist | ( | Pointer | raw_searcher, | |
String | key, | |||
int | begin, | |||
int | num, | |||
Postlist.Head | header | |||
) | [private] |
Class<V> de::aitools::aq::invertedindex::core::Searcher< V extends Value >::clazz [private] |
Definition at line 186 of file Searcher.java.
Pointer de::aitools::aq::invertedindex::core::Searcher< V extends Value >::nativeSearcher [private] |
Definition at line 184 of file Searcher.java.
Properties de::aitools::aq::invertedindex::core::Searcher< V extends Value >::props [private] |
Definition at line 185 of file Searcher.java.