railo.runtime.search
Class SearchCollectionSupport

java.lang.Object
  extended by railo.runtime.search.SearchCollectionSupport
All Implemented Interfaces:
Serializable, SearchCollection, SearchCollectionPlus
Direct Known Subclasses:
LuceneSearchCollection

public abstract class SearchCollectionSupport
extends Object
implements SearchCollectionPlus

represent a single Collection

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface railo.runtime.search.SearchCollection
SEARCH_TYPE_EXPLICIT, SEARCH_TYPE_SIMPLE
 
Constructor Summary
SearchCollectionSupport(SearchEngineSupport searchEngine, String name, Resource path, String language, DateTime lastUpdate, DateTime created)
          constructor of the class
 
Method Summary
 void addIndex(SearchIndex index)
           
 void create()
          create a collection
 Object created()
          return time when collection was created
 IndexResult delete()
          delete the collection
 IndexResult deleteCustom(String id, QueryColumn keyColumn)
           
 IndexResult deleteIndex(PageContext pc, String key, short type, String queryName)
          delete a Index from collection
 IndexResult deleteIndexNotCustom(PageContext pc, String key, short type, String queryName)
           
 DateTime getCreated()
           
static String getDirectory(String strUrl)
           
 Object getIndexesAsQuery()
           
 String getLanguage()
           
 DateTime getLastUpdate()
           
 Log getLogger()
           
 String getName()
           
 Resource getPath()
           
 SearchEngine getSearchEngine()
           
 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, long timeout, String custom1, String custom2, String custom3, String custom4)
           
 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, Object title, QueryColumn keyColumn, QueryColumn[] bodyColumns, String language, Object urlpath, Object custom1, Object custom2, Object custom3, Object custom4)
           
 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 res, 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
 IndexResult indexURL(String id, String title, URL url, String[] extensions, boolean recurse, String language, long timeout)
           
 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[] categories)
          search the collection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface railo.runtime.search.SearchCollection
_search, getCategoryInfo, getDocumentCount, getDocumentCount, getSize
 

Constructor Detail

SearchCollectionSupport

public SearchCollectionSupport(SearchEngineSupport searchEngine,
                               String name,
                               Resource path,
                               String language,
                               DateTime lastUpdate,
                               DateTime created)
constructor of the class

Parameters:
searchEngine -
name - name of the Collection
path -
language -
count - total count of documents in the collection
lastUpdate -
created -
Method Detail

create

public final void create()
                  throws SearchException
Description copied from interface: SearchCollection
create a collection

Specified by:
create in interface SearchCollection
Throws:
SearchException

optimize

public final void optimize()
                    throws SearchException
Description copied from interface: SearchCollection
optimize a Collection

Specified by:
optimize in interface SearchCollection
Throws:
SearchException

map

public final void map(Resource path)
               throws SearchException
Description copied from interface: SearchCollection
map a Collection

Specified by:
map in interface SearchCollection
Throws:
SearchException

repair

public final void repair()
                  throws SearchException
Description copied from interface: SearchCollection
repair a Collection

Specified by:
repair in interface SearchCollection
Throws:
SearchException

index

public 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
Description copied from interface: SearchCollection
updates a index of a collection

Specified by:
index in interface SearchCollection
Throws:
PageException
MalformedURLException
SearchException

index

public 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,
                         long timeout,
                         String custom1,
                         String custom2,
                         String custom3,
                         String custom4)
                  throws PageException,
                         MalformedURLException,
                         SearchException
Throws:
PageException
MalformedURLException
SearchException

indexFile

public final IndexResult indexFile(String id,
                                   String title,
                                   Resource res,
                                   String language)
                            throws SearchException
Description copied from interface: SearchCollection
updates a collection with a file

Specified by:
indexFile in interface SearchCollection
Throws:
SearchException

indexPath

public final IndexResult indexPath(String id,
                                   String title,
                                   Resource dir,
                                   String[] extensions,
                                   boolean recurse,
                                   String language)
                            throws SearchException
Description copied from interface: SearchCollection
updates a collection with a path

Specified by:
indexPath in interface SearchCollection
Throws:
SearchException

indexURL

public final IndexResult indexURL(String id,
                                  String title,
                                  URL url,
                                  String[] extensions,
                                  boolean recurse,
                                  String language)
                           throws SearchException
Description copied from interface: SearchCollection
updates a collection with a url

Specified by:
indexURL in interface SearchCollection
Throws:
SearchException

indexURL

public final IndexResult indexURL(String id,
                                  String title,
                                  URL url,
                                  String[] extensions,
                                  boolean recurse,
                                  String language,
                                  long timeout)
                           throws SearchException
Throws:
SearchException

indexCustom

public final IndexResult indexCustom(String id,
                                     QueryColumn title,
                                     QueryColumn keyColumn,
                                     QueryColumn[] bodyColumns,
                                     String language,
                                     QueryColumn custom1,
                                     QueryColumn custom2,
                                     QueryColumn custom3,
                                     QueryColumn custom4)
                              throws SearchException
Description copied from interface: SearchCollection
updates a collection with a custom

Specified by:
indexCustom in interface SearchCollection
title - Title for the Index
keyColumn - Key Column
bodyColumns - Body Column Array
language - Language for index
Throws:
SearchException

indexCustom

public final IndexResult indexCustom(String id,
                                     Object title,
                                     QueryColumn keyColumn,
                                     QueryColumn[] bodyColumns,
                                     String language,
                                     Object urlpath,
                                     Object custom1,
                                     Object custom2,
                                     Object custom3,
                                     Object custom4)
                              throws SearchException
Throws:
SearchException

deleteCustom

public final IndexResult deleteCustom(String id,
                                      QueryColumn keyColumn)
                               throws SearchException
Throws:
SearchException

addIndex

public void addIndex(SearchIndex index)
Specified by:
addIndex in interface SearchCollectionPlus
Parameters:
index -

getLanguage

public final String getLanguage()
Specified by:
getLanguage in interface SearchCollection
Returns:
Returns the language.

purge

public final IndexResult purge()
                        throws SearchException
Description copied from interface: SearchCollection
purge a collection

Specified by:
purge in interface SearchCollection
Throws:
SearchException

delete

public final IndexResult delete()
                         throws SearchException
Description copied from interface: SearchCollection
delete the collection

Specified by:
delete in interface SearchCollection
Throws:
SearchException

deleteIndex

public final IndexResult deleteIndex(PageContext pc,
                                     String key,
                                     short type,
                                     String queryName)
                              throws SearchException
Description copied from interface: SearchCollection
delete a Index from collection

Specified by:
deleteIndex in interface SearchCollection
Throws:
SearchException

deleteIndexNotCustom

public final IndexResult deleteIndexNotCustom(PageContext pc,
                                              String key,
                                              short type,
                                              String queryName)
                                       throws SearchException
Throws:
SearchException

getPath

public final Resource getPath()
Specified by:
getPath in interface SearchCollection
Returns:
Returns the path.

getCreated

public DateTime getCreated()
Specified by:
getCreated in interface SearchCollection
Returns:
returns when collection is created

getLastUpdate

public final DateTime getLastUpdate()
Specified by:
getLastUpdate in interface SearchCollection
Returns:
Returns the lastUpdate.

getName

public final String getName()
Specified by:
getName in interface SearchCollection
Returns:
Returns the name.

getLogger

public final Log getLogger()
Specified by:
getLogger in interface SearchCollection
Returns:
Returns the logFile.

getSearchEngine

public final SearchEngine getSearchEngine()
Specified by:
getSearchEngine in interface SearchCollection
Returns:
Returns the searchEngine.

created

public Object created()
Description copied from interface: SearchCollection
return time when collection was created

Specified by:
created in interface SearchCollection
Returns:
create time

search

public final int search(SearchData data,
                        Query qry,
                        String criteria,
                        String language,
                        short type,
                        int startrow,
                        int maxrow,
                        String categoryTree,
                        String[] categories)
                 throws SearchException,
                        PageException
Description copied from interface: SearchCollection
search the collection

Specified by:
search in interface SearchCollection
qry - Query to append resuts
type - SEARCH_TYPE_EXPLICIT or SEARCH_TYPE_SIMPLE
Returns:
new startrow
Throws:
SearchException
PageException

getDirectory

public static String getDirectory(String strUrl)
                           throws MalformedURLException
Throws:
MalformedURLException

getIndexesAsQuery

public Object getIndexesAsQuery()


Copyright © 2012 Railo