lempinen.neatseeker.core
Class NeatSeeker

java.lang.Object
  |
  +--lempinen.neatseeker.core.NeatSeeker

public class NeatSeeker
extends java.lang.Object

The NeatSeeker search front-end class.

This class provides services for searching the NeatSeeker index. Actual search front-ends should extend (or with servlets, aggregate) this class.

Version:
$Id: NeatSeeker.java,v 1.5 2000/09/27 17:01:25 lempinen Exp $
Author:
Sami Lempinen

Field Summary
protected  Configuration conf
          The Configuration object.
protected  Repository repository
          The repository object.
protected  Statistics statistics
          The Statistics object.
protected  Stemmer stemmer
          The stemmer object.
protected  Weighter weighter
          The Weighter object.
 
Constructor Summary
NeatSeeker(Configuration c)
          Creates a new NeatSeeker object with the given configuration.
 
Method Summary
protected  PointerList doSearch(java.lang.String[] keys, int index)
          Searches for an array of keywords.
 Target getTarget(long id)
          Returns the Target from the Repository.
static void main(java.lang.String[] args)
          Main method.
 PointerList search(java.lang.String query)
          Parses a search string into an array of search terms and runs the search.
 PointerList search(java.lang.String[] query)
          Parses an array of search terms and runs the search.
protected  PointerList searchPhrase(java.lang.String phrase)
          Performs a phrase search for two or more words.
 PointerList searchSimple(java.lang.String key)
          Searches for a particular key string.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

repository

protected Repository repository
The repository object.

stemmer

protected Stemmer stemmer
The stemmer object.

conf

protected Configuration conf
The Configuration object.

statistics

protected Statistics statistics
The Statistics object.

weighter

protected Weighter weighter
The Weighter object.
Constructor Detail

NeatSeeker

public NeatSeeker(Configuration c)
           throws java.io.IOException
Creates a new NeatSeeker object with the given configuration.
Method Detail

search

public PointerList search(java.lang.String[] query)
Parses an array of search terms and runs the search.

Returns a PointerList that represents the search results.


search

public PointerList search(java.lang.String query)
                   throws java.io.IOException
Parses a search string into an array of search terms and runs the search.

This form of search() is useful e.g. in a CGI/Servlet environment, where the query comes in the form of a single string.

Returns a PointerList that represents the search results.


doSearch

protected PointerList doSearch(java.lang.String[] keys,
                               int index)
Searches for an array of keywords.

searchSimple

public PointerList searchSimple(java.lang.String key)
Searches for a particular key string. This method overrides the default one in Repository, and adds phrase checking.

searchPhrase

protected PointerList searchPhrase(java.lang.String phrase)
Performs a phrase search for two or more words. Phrase search is merely a specialised case of proximity search, but the phrase needs to be tokenised first.

getTarget

public Target getTarget(long id)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Returns the Target from the Repository.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Main method. Not really useful for anything except testing.