com.arsdigita.search.lucene
Class LuceneSearch

java.lang.Object
  extended bycom.arsdigita.search.lucene.LuceneSearch
Direct Known Subclasses:
LuceneSearch

public class LuceneSearch
extends Object

LuceneSearch is a wrapper for the Lucene search facilities. It contains constructors to create new searches and methods to iterate over and to get information for each hit.

Version:
$Id: //core-platform/dev/src/com/arsdigita/search/lucene/LuceneSearch.java#3 $
Author:
Richard Su (richard.su@alum.mit.edu)

Constructor Summary
LuceneSearch(org.apache.lucene.search.Query q)
          Search given a preformed query.
LuceneSearch(String searchString)
          Search over all objects in the system.
LuceneSearch(String searchString, org.apache.lucene.search.Filter f)
          Search over all objects in the system using a filter
LuceneSearch(String searchString, String objectType)
          Search for a specific ACS object and search string.
 
Method Summary
 void close()
          Closes this search, freeing associated resources.
 String getContent()
          Returns the content
 Date getCreationDate()
           
 BigDecimal getID()
          Returns the object ID
 Date getLastModifiedDate()
           
 Locale getLocale()
          Returns the locale the content is in
 float getScore()
          Returns the score of this hit.
 String getSummary()
          Returns a summary for the hit
 String getTitle()
          Returns the link text for the object
 String getType()
          Returns the object type.
 String getTypeSpecificInfo()
          Returns type-specific info.
 boolean next()
          Returns true if the search has more results
 int size()
          Returns the number of hits in this query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneSearch

public LuceneSearch(String searchString)
Search over all objects in the system. Returns objects that matches the search string.

Parameters:
searchString - user specified search string

LuceneSearch

public LuceneSearch(String searchString,
                    String objectType)
Search for a specific ACS object and search string.

Parameters:
searchString - user specified search string
objectType - ACS object type

LuceneSearch

public LuceneSearch(String searchString,
                    org.apache.lucene.search.Filter f)
Search over all objects in the system using a filter

Parameters:
searchString - user specified search string
f - a filter

LuceneSearch

public LuceneSearch(org.apache.lucene.search.Query q)
Search given a preformed query.

Parameters:
q - a performed query
Method Detail

size

public int size()
Returns the number of hits in this query.


next

public boolean next()
Returns true if the search has more results

Returns:
true if the search has more results

close

public void close()
Closes this search, freeing associated resources.


getScore

public float getScore()
Returns the score of this hit.


getID

public BigDecimal getID()
Returns the object ID

Returns:
the object id

getLocale

public Locale getLocale()
Returns the locale the content is in

Returns:
the locale the content is in

getType

public String getType()
Returns the object type.

Returns:
the object type

getTypeSpecificInfo

public String getTypeSpecificInfo()
Returns type-specific info.

Returns:
the type-specific info

getTitle

public String getTitle()
Returns the link text for the object

Returns:
the link text for the object

getSummary

public String getSummary()
Returns a summary for the hit

Returns:
a summary for the hit

getContent

public String getContent()
Returns the content

Returns:
the content

getCreationDate

public Date getCreationDate()

getLastModifiedDate

public Date getLastModifiedDate()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC