railo.runtime.search
Interface SearchCollection

All Superinterfaces:
java.io.Serializable

public interface SearchCollection
extends java.io.Serializable

a Search Collection


Field Summary
static short SEARCH_TYPE_EXPLICIT
          Field SEARCH_TYPE_EXPLICIT
static short SEARCH_TYPE_SIMPLE
          Field SEARCH_TYPE_SIMPLE
 
Method Summary
 SearchResulItem[] _search(SearchData data, java.lang.String criteria, java.lang.String language, short type, java.lang.String categoryTree, java.lang.String[] category)
          search the collection
 void create()
          create a collection
 java.lang.Object created()
          return time when collection was created
 IndexResult delete()
          delete the collection
 IndexResult deleteIndex(PageContext pc, java.lang.String key, short type, java.lang.String queryName)
          delete a Index from collection
 java.lang.Object getCategoryInfo()
           
 DateTime getCreated()
           
 int getDocumentCount()
           
 int getDocumentCount(java.lang.String id)
           
 java.lang.String getLanguage()
           
 DateTime getLastUpdate()
           
 Log getLogger()
           
 java.lang.String getName()
           
 Resource getPath()
           
 SearchEngine getSearchEngine()
           
 long getSize()
           
 IndexResult index(PageContext pc, java.lang.String key, short type, java.lang.String urlpath, java.lang.String title, java.lang.String body, java.lang.String language, java.lang.String[] extensions, java.lang.String query, boolean recurse, java.lang.String categoryTree, java.lang.String[] categories, java.lang.String custom1, java.lang.String custom2, java.lang.String custom3, java.lang.String custom4)
          updates a index of a collection
 IndexResult indexCustom(java.lang.String id, QueryColumn title, QueryColumn keyColumn, QueryColumn[] bodyColumns, java.lang.String language, QueryColumn custom1, QueryColumn custom2, QueryColumn custom3, QueryColumn custom4)
          updates a collection with a custom
 IndexResult indexFile(java.lang.String id, java.lang.String title, Resource file, java.lang.String language)
          updates a collection with a file
 IndexResult indexPath(java.lang.String id, java.lang.String title, Resource dir, java.lang.String[] extensions, boolean recurse, java.lang.String language)
          updates a collection with a path
 IndexResult indexURL(java.lang.String id, java.lang.String title, java.net.URL url, java.lang.String[] extensions, boolean recurse, java.lang.String language)
          updates a collection with a url
 void map(Resource path)
          map a Collection
 void optimize()
          optimize a Collection
 IndexResult purge()
          purge a collection
 void repair()
          repair a Collection
 int search(SearchData data, Query qry, java.lang.String criteria, java.lang.String language, short type, int startrow, int maxrow, java.lang.String categoryTree, java.lang.String[] category)
          search the collection
 

Field Detail

SEARCH_TYPE_SIMPLE

public static final short SEARCH_TYPE_SIMPLE
Field SEARCH_TYPE_SIMPLE

See Also:
Constant Field Values

SEARCH_TYPE_EXPLICIT

public static final short SEARCH_TYPE_EXPLICIT
Field SEARCH_TYPE_EXPLICIT

See Also:
Constant Field Values
Method Detail

create

public void create()
            throws SearchException
create a collection

Throws:
SearchException

optimize

public void optimize()
              throws SearchException
optimize a Collection

Throws:
SearchException

map

public void map(Resource path)
         throws SearchException
map a Collection

Parameters:
path -
Throws:
SearchException

repair

public void repair()
            throws SearchException
repair a Collection

Throws:
SearchException

index

public IndexResult index(PageContext pc,
                         java.lang.String key,
                         short type,
                         java.lang.String urlpath,
                         java.lang.String title,
                         java.lang.String body,
                         java.lang.String language,
                         java.lang.String[] extensions,
                         java.lang.String query,
                         boolean recurse,
                         java.lang.String categoryTree,
                         java.lang.String[] categories,
                         java.lang.String custom1,
                         java.lang.String custom2,
                         java.lang.String custom3,
                         java.lang.String custom4)
                  throws PageException,
                         java.net.MalformedURLException,
                         SearchException
updates a index of a collection

Parameters:
pc -
key -
type -
urlpath -
title -
body -
language -
extensions -
query -
recurse -
categoryTree -
categories -
custom1 -
custom2 -
custom3 -
custom4 -
Returns:
Throws:
PageException
java.net.MalformedURLException
SearchException

indexFile

public IndexResult indexFile(java.lang.String id,
                             java.lang.String title,
                             Resource file,
                             java.lang.String language)
                      throws SearchException
updates a collection with a file

Parameters:
id -
title -
file -
language -
Throws:
SearchException

indexPath

public IndexResult indexPath(java.lang.String id,
                             java.lang.String title,
                             Resource dir,
                             java.lang.String[] extensions,
                             boolean recurse,
                             java.lang.String language)
                      throws SearchException
updates a collection with a path

Parameters:
id -
title -
dir -
recurse -
extensions -
language -
Throws:
SearchException

indexURL

public IndexResult indexURL(java.lang.String id,
                            java.lang.String title,
                            java.net.URL url,
                            java.lang.String[] extensions,
                            boolean recurse,
                            java.lang.String language)
                     throws SearchException
updates a collection with a url

Parameters:
id -
title -
recurse -
extensions -
url -
language -
Throws:
SearchException

indexCustom

public IndexResult indexCustom(java.lang.String id,
                               QueryColumn title,
                               QueryColumn keyColumn,
                               QueryColumn[] bodyColumns,
                               java.lang.String language,
                               QueryColumn custom1,
                               QueryColumn custom2,
                               QueryColumn custom3,
                               QueryColumn custom4)
                        throws SearchException
updates a collection with a custom

Parameters:
id -
title - Title for the Index
keyColumn - Key Column
bodyColumns - Body Column Array
language - Language for index
custom1 -
custom2 -
custom3 -
custom4 -
Throws:
SearchException

getLanguage

public java.lang.String getLanguage()
Returns:
Returns the language.

purge

public IndexResult purge()
                  throws SearchException
purge a collection

Throws:
SearchException

delete

public IndexResult delete()
                   throws SearchException
delete the collection

Throws:
SearchException

deleteIndex

public IndexResult deleteIndex(PageContext pc,
                               java.lang.String key,
                               short type,
                               java.lang.String queryName)
                        throws SearchException
delete a Index from collection

Parameters:
pc -
key -
type -
queryName -
Throws:
SearchException

getPath

public Resource getPath()
Returns:
Returns the path.

getCreated

public DateTime getCreated()
Returns:
returns when collection is created

getLastUpdate

public DateTime getLastUpdate()
Returns:
Returns the lastUpdate.

getName

public java.lang.String getName()
Returns:
Returns the name.

getLogger

public Log getLogger()
Returns:
Returns the logFile.

getSearchEngine

public SearchEngine getSearchEngine()
Returns:
Returns the searchEngine.

created

public java.lang.Object created()
return time when collection was created

Returns:
create time

search

public int search(SearchData data,
                  Query qry,
                  java.lang.String criteria,
                  java.lang.String language,
                  short type,
                  int startrow,
                  int maxrow,
                  java.lang.String categoryTree,
                  java.lang.String[] category)
           throws SearchException,
                  PageException
search the collection

Parameters:
data -
qry - Query to append resuts
criteria -
language -
type - SEARCH_TYPE_EXPLICIT or SEARCH_TYPE_SIMPLE
startrow -
maxrow -
categoryTree -
category -
Returns:
new startrow
Throws:
SearchException
PageException

_search

public SearchResulItem[] _search(SearchData data,
                                 java.lang.String criteria,
                                 java.lang.String language,
                                 short type,
                                 java.lang.String categoryTree,
                                 java.lang.String[] category)
                          throws SearchException
search the collection

Parameters:
data -
criteria -
language -
type - SEARCH_TYPE_EXPLICIT or SEARCH_TYPE_SIMPLE
categoryTree -
category -
Returns:
Result as SearchRecord Array
Throws:
SearchException

getSize

public long getSize()
Returns:
the size of the collection in KB

getDocumentCount

public int getDocumentCount()
Returns:
the counts of the documents in the collection

getDocumentCount

public int getDocumentCount(java.lang.String id)

getCategoryInfo

public java.lang.Object getCategoryInfo()