com.bitmechanic.spindle
Class Search

java.lang.Object
  |
  +--com.bitmechanic.spindle.Search

public class Search
extends java.lang.Object
implements com.bitmechanic.listlib.ListCreator

Use this class to search indexes created by the Spider class.

Version:
$Id: Search.java,v 1.5 2002/03/30 20:25:46 pixel Exp $
Author:
James Cooper

Constructor Summary
Search()
           
 
Method Summary
 com.bitmechanic.listlib.ListContainer execute(javax.servlet.jsp.PageContext context, int offset, int max)
          Runs a query against the index in the directory specified.
static void main(java.lang.String[] args)
          Command line usage: java com.bitmechanic.spindle.Search [index dir] [keyword]
static java.util.ArrayList search(java.lang.String dir, java.lang.String query)
          Runs a query against the index in the directory specified.
static ListDesc search(java.lang.String dir, java.lang.String query, int offset, int max)
          Runs a query against the index in the directory specified.
 void setDir(java.lang.String dir)
           
 void setQuery(java.lang.String query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Search

public Search()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Command line usage: java com.bitmechanic.spindle.Search [index dir] [keyword]

search

public static java.util.ArrayList search(java.lang.String dir,
                                         java.lang.String query)
                                  throws java.lang.Exception
Runs a query against the index in the directory specified. Returns a list of HashMap objects. The objects have the following keys: 'url', 'title', 'desc', 'score'.
Parameters:
dir - Directory containing the index to search
query - Query to run against the index

search

public static ListDesc search(java.lang.String dir,
                              java.lang.String query,
                              int offset,
                              int max)
                       throws java.lang.Exception
Runs a query against the index in the directory specified. Returns a list of HashMap objects. The objects have the following keys: 'url', 'title', 'desc', 'score'.
Parameters:
dir - Directory containing the index to search
query - Query to run against the index
offset - Position in the result set to start returning results
max - Max number of results to return

setDir

public void setDir(java.lang.String dir)

setQuery

public void setQuery(java.lang.String query)

execute

public com.bitmechanic.listlib.ListContainer execute(javax.servlet.jsp.PageContext context,
                                                     int offset,
                                                     int max)
                                              throws java.lang.Exception
Runs a query against the index in the directory specified. Returns a list of HashMap objects. The objects have the following keys: 'url', 'title', 'desc', 'score'.
Specified by:
execute in interface com.bitmechanic.listlib.ListCreator
Parameters:
dir - Directory containing the index to search
query - Query to run against the index
offset - Position in the result set to start returning results
max - Max number of results to return