org.dspace.search
Class DSQuery

java.lang.Object
  extended by org.dspace.search.DSQuery

public class DSQuery
extends Object

DSIndexer contains various static methods for performing queries on indices, for collections and communities.


Constructor Summary
DSQuery()
           
 
Method Summary
static void close()
          Close any IndexSearcher that is currently open.
static void doCMDLineQuery(String query)
          Do a query, printing results to stdout largely for testing, but it is useful
static QueryResults doQuery(Context c, QueryArgs args)
          Do a query, returning a QueryResults object
static QueryResults doQuery(Context c, QueryArgs args, Collection coll)
          Do a query, restricted to a collection
static QueryResults doQuery(Context c, QueryArgs args, Community comm)
          Do a query, restricted to a community
protected static org.apache.lucene.index.IndexReader getIndexReader()
          get an IndexReader.
protected static org.apache.lucene.search.IndexSearcher getSearcher(Context c)
          get an IndexSearcher, hopefully a cached one (gives much better performance.) checks to see if the index has been modified - if so, it creates a new IndexSearcher
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSQuery

public DSQuery()
Method Detail

doQuery

public static QueryResults doQuery(Context c,
                                   QueryArgs args)
                            throws IOException
Do a query, returning a QueryResults object

Parameters:
c - context
args - query arguments in QueryArgs object
Returns:
query results QueryResults
Throws:
IOException

doQuery

public static QueryResults doQuery(Context c,
                                   QueryArgs args,
                                   Collection coll)
                            throws IOException
Do a query, restricted to a collection

Parameters:
c - context
args - query args
coll - collection to restrict to
Returns:
QueryResults same results as doQuery, restricted to a collection
Throws:
IOException

doQuery

public static QueryResults doQuery(Context c,
                                   QueryArgs args,
                                   Community comm)
                            throws IOException
Do a query, restricted to a community

Parameters:
c - context
args - query args
comm - community to restrict to
Returns:
QueryResults same results as doQuery, restricted to a collection
Throws:
IOException

doCMDLineQuery

public static void doCMDLineQuery(String query)
Do a query, printing results to stdout largely for testing, but it is useful


close

public static void close()
Close any IndexSearcher that is currently open.


main

public static void main(String[] args)

getIndexReader

protected static org.apache.lucene.index.IndexReader getIndexReader()
                                                             throws IOException
get an IndexReader.

Throws:
IOException

getSearcher

protected static org.apache.lucene.search.IndexSearcher getSearcher(Context c)
                                                             throws IOException
get an IndexSearcher, hopefully a cached one (gives much better performance.) checks to see if the index has been modified - if so, it creates a new IndexSearcher

Throws:
IOException


Copyright © 2010 DuraSpace. All Rights Reserved.