public class Search
extends java.lang.Object
Indexer
.Modifier and Type | Field and Description |
---|---|
int |
pagelen
A default quantity (20) of
SearchResultItem objects
in SearchResult returned by search(java.lang.String, int) method per one call |
Constructor and Description |
---|
Search(java.lang.String indexfile)
Creates a class instance for searching via given index.
|
Modifier and Type | Method and Description |
---|---|
SearchResult |
search(java.lang.String s,
int npage)
Performs a full-text search in the current index.
|
public int pagelen
SearchResultItem
objects
in SearchResult
returned by search(java.lang.String, int)
method per one callpublic Search(java.lang.String indexfile) throws java.sql.SQLException, java.lang.ClassNotFoundException
indexfile
- the index file for searching. This file
must be created by Indexer
.java.sql.SQLException
java.lang.ClassNotFoundException
public SearchResult search(java.lang.String s, int npage) throws java.sql.SQLException, java.io.IOException, java.util.zip.DataFormatException
pagelen
objects.
Method returns a result for a single given page. The page numbering begins with 1.s
- search phrasenpage
- required page number of the search result.SearchResult
object which consists of pagelen
SearchResultItem
list for page № npage
.java.sql.SQLException
java.io.IOException
java.util.zip.DataFormatException