railo.runtime.search
Interface SearchCollection

All Superinterfaces:
Serializable
All Known Subinterfaces:
SearchCollectionPlus
All Known Implementing Classes:
LuceneSearchCollection, SearchCollectionSupport, SearchCollectionSupport2

public interface SearchCollection
extends 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, String criteria, String language, short type, String categoryTree, String[] category)
          search the collection
 void create()
          create a collection
 Object created()
          return time when collection was created
 IndexResult delete()
          delete the collection
 IndexResult deleteIndex(PageContext pc, String key, short type, String queryName)
          delete a Index from collection
 Object getCategoryInfo()
           
 DateTime getCreated()
           
 int getDocumentCount()
           
 int getDocumentCount(String id)
           
 String getLanguage()
           
 DateTime getLastUpdate()
           
 Log getLogger()
           
 String getName()
           
 Resource getPath()
           
 SearchEngine getSearchEngine()
           
 long getSize()
           
 IndexResult index(PageContext pc, String key, short type, String urlpath, String title, String body, String language, String[] extensions, String query, boolean recurse, String categoryTree, String[] categories, String custom1, String custom2, String custom3, String custom4)
          updates a index of a collection
 IndexResult indexCustom(String id, QueryColumn title, QueryColumn keyColumn, QueryColumn[] bodyColumns, String language, QueryColumn custom1, QueryColumn custom2, QueryColumn custom3, QueryColumn custom4)
          updates a collection with a custom
 IndexResult indexFile(String id, String title, Resource file, String language)
          updates a collection with a file
 IndexResult indexPath(String id, String title, Resource dir, String[] extensions, boolean recurse, String language)
          updates a collection with a path
 IndexResult indexURL(String id, String title, URL url, String[] extensions, boolean recurse, 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, String criteria, String language, short type, int startrow, int maxrow, String categoryTree, String[] category)
          search the collection
 

Field Detail

SEARCH_TYPE_SIMPLE

static final short SEARCH_TYPE_SIMPLE
Field SEARCH_TYPE_SIMPLE

See Also:
Constant Field Values

SEARCH_TYPE_EXPLICIT

static final short SEARCH_TYPE_EXPLICIT
Field SEARCH_TYPE_EXPLICIT

See Also:
Constant Field Values
Method Detail

create

void create()
            throws SearchException
create a collection

Throws:
SearchException

optimize

void optimize()
              throws SearchException
optimize a Collection

Throws:
SearchException

map

void map(Resource path)
         throws SearchException
map a Collection

Parameters:
path -
Throws:
SearchException

repair

void repair()
            throws SearchException
repair a Collection

Throws:
SearchException

index

IndexResult index(PageContext pc,
                  String key,
                  short type,
                  String urlpath,
                  String title,
                  String body,
                  String language,
                  String[] extensions,
                  String query,
                  boolean recurse,
                  String categoryTree,
                  String[] categories,
                  String custom1,
                  String custom2,
                  String custom3,
                  String custom4)
                  throws PageException,
                         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 -
Throws:
PageException
MalformedURLException
SearchException

indexFile

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

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

indexPath

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

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

indexURL

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

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

indexCustom

IndexResult indexCustom(String id,
                        QueryColumn title,
                        QueryColumn keyColumn,
                        QueryColumn[] bodyColumns,
                        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

String getLanguage()
Returns:
Returns the language.

purge

IndexResult purge()
                  throws SearchException
purge a collection

Throws:
SearchException

delete

IndexResult delete()
                   throws SearchException
delete the collection

Throws:
SearchException

deleteIndex

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

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

getPath

Resource getPath()
Returns:
Returns the path.

getCreated

DateTime getCreated()
Returns:
returns when collection is created

getLastUpdate

DateTime getLastUpdate()
Returns:
Returns the lastUpdate.

getName

String getName()
Returns:
Returns the name.

getLogger

Log getLogger()
Returns:
Returns the logFile.

getSearchEngine

SearchEngine getSearchEngine()
Returns:
Returns the searchEngine.

created

Object created()
return time when collection was created

Returns:
create time

search

int search(SearchData data,
           Query qry,
           String criteria,
           String language,
           short type,
           int startrow,
           int maxrow,
           String categoryTree,
           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

SearchResulItem[] _search(SearchData data,
                          String criteria,
                          String language,
                          short type,
                          String categoryTree,
                          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

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

getDocumentCount

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

getDocumentCount

int getDocumentCount(String id)

getCategoryInfo

Object getCategoryInfo()


Copyright © 2012 Railo