public class DbSearchModule extends Object implements SearchModule
Constructor and Description |
---|
DbSearchModule() |
Modifier and Type | Method and Description |
---|---|
void |
deleteSearch(String token,
long qpId)
Delete a saved search.
|
List<QueryResult> |
find(String token,
QueryParams params)
Performs a complex search by content, name and keywords (between others).
|
List<QueryResult> |
findByContent(String token,
String expression)
Search for documents using it indexed content.
|
List<QueryResult> |
findByKeywords(String token,
Set<String> expression)
Search for documents using it associated keywords.
|
List<QueryResult> |
findByName(String token,
String expression)
Search for documents by document name.
|
ResultSet |
findMoreLikeThis(String token,
String uuid,
int maxResults)
Find documents like a given one.
|
ResultSet |
findPaginated(String token,
QueryParams params,
int offset,
int limit)
Performs a complex search by content, name and keywords.
|
List<QueryResult> |
findSimpleQuery(String token,
String statement)
Performs a simple search using on GQL language.
|
ResultSet |
findSimpleQueryPaginated(String token,
String statement,
int offset,
int limit)
Performs a simple search using GQL languahe.
|
List<QueryParams> |
getAllSearchs(String token)
Get all saved search.
|
List<Document> |
getCategorizedDocuments(String token,
String categoryId)
Get the documents within a category
|
List<Folder> |
getCategorizedFolders(String token,
String categoryId)
Get the folders within a category
|
List<Mail> |
getCategorizedMails(String token,
String categoryId)
Get the mails within a category
|
List<Document> |
getDocumentsByKeyword(String token,
String keyword)
Get the documents with a keyword
|
List<Document> |
getDocumentsByPropertyValue(String token,
String group,
String property,
String value)
Get the documents with a property value
|
List<Folder> |
getFoldersByKeyword(String token,
String keyword)
Get the folders with a keyword
|
List<Folder> |
getFoldersByPropertyValue(String token,
String group,
String property,
String value)
Get the folders with a property value
|
Map<String,Integer> |
getKeywordMap(String token,
List<String> filter)
Return a Keyword map.
|
List<Mail> |
getMailsByKeyword(String token,
String keyword)
Get the mails with a keyword
|
List<Mail> |
getMailsByPropertyValue(String token,
String group,
String property,
String value)
Get the mails with a property value
|
QueryParams |
getSearch(String token,
int qpId)
Get a saved search.
|
org.apache.lucene.search.Query |
prepareStatement(QueryParams params)
Prepare statement
|
long |
saveSearch(String token,
QueryParams params)
Save a search for future use.
|
void |
updateSearch(String token,
QueryParams params)
Updated a saved search.
|
public List<QueryResult> findByContent(String token, String expression) throws IOException, ParseException, AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findByContent
in interface SearchModule
expression
- Expression to be searched.RepositoryException
- If there is any general repository problem.IOException
ParseException
AccessDeniedException
DatabaseException
public List<QueryResult> findByName(String token, String expression) throws IOException, ParseException, AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findByName
in interface SearchModule
expression
- Expression to be searched.RepositoryException
- If there is any general repository problem.IOException
ParseException
AccessDeniedException
DatabaseException
public List<QueryResult> findByKeywords(String token, Set<String> expression) throws IOException, ParseException, AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findByKeywords
in interface SearchModule
expression
- Expression to be searched.RepositoryException
- If there is any general repository problem.IOException
ParseException
AccessDeniedException
DatabaseException
public List<QueryResult> find(String token, QueryParams params) throws IOException, ParseException, AccessDeniedException, RepositoryException, DatabaseException
SearchModule
find
in interface SearchModule
params
- The complex search elements.IOException
- If something fails when parsing metadata.RepositoryException
- If there is any general repository problem.ParseException
AccessDeniedException
DatabaseException
public ResultSet findPaginated(String token, QueryParams params, int offset, int limit) throws IOException, ParseException, AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findPaginated
in interface SearchModule
params
- The complex search elements.offset
- Query result list offset.limit
- Query result list limit.RepositoryException
- If there is any general repository problem.IOException
ParseException
AccessDeniedException
DatabaseException
public org.apache.lucene.search.Query prepareStatement(QueryParams params) throws IOException, ParseException, RepositoryException, DatabaseException
public long saveSearch(String token, QueryParams params) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
saveSearch
in interface SearchModule
params
- The query params.RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public void updateSearch(String token, QueryParams params) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
updateSearch
in interface SearchModule
params
- The query params.RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public QueryParams getSearch(String token, int qpId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
SearchModule
getSearch
in interface SearchModule
RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
PathNotFoundException
DatabaseException
public List<QueryParams> getAllSearchs(String token) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getAllSearchs
in interface SearchModule
RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public void deleteSearch(String token, long qpId) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
deleteSearch
in interface SearchModule
RepositoryException
- If there is any general repository problem or the query failsAccessDeniedException
DatabaseException
public Map<String,Integer> getKeywordMap(String token, List<String> filter) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getKeywordMap
in interface SearchModule
filter
- A collection of keywords used to obtain the related document keywords.RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Document> getCategorizedDocuments(String token, String categoryId) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getCategorizedDocuments
in interface SearchModule
categoryId
- The category id (UUID)RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Folder> getCategorizedFolders(String token, String categoryId) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getCategorizedFolders
in interface SearchModule
categoryId
- The category id (UUID)RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Mail> getCategorizedMails(String token, String categoryId) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getCategorizedMails
in interface SearchModule
categoryId
- The category id (UUID)RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Document> getDocumentsByKeyword(String token, String keyword) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getDocumentsByKeyword
in interface SearchModule
keyword
- The keywordRepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Folder> getFoldersByKeyword(String token, String keyword) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getFoldersByKeyword
in interface SearchModule
keyword
- The keywordRepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Mail> getMailsByKeyword(String token, String keyword) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getMailsByKeyword
in interface SearchModule
keyword
- The keywordRepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Document> getDocumentsByPropertyValue(String token, String group, String property, String value) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getDocumentsByPropertyValue
in interface SearchModule
RepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Folder> getFoldersByPropertyValue(String token, String group, String property, String value) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getFoldersByPropertyValue
in interface SearchModule
property
- The property valueRepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<Mail> getMailsByPropertyValue(String token, String group, String property, String value) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
getMailsByPropertyValue
in interface SearchModule
property
- The property valueRepositoryException
- If there is any general repository problem or the query fails.AccessDeniedException
DatabaseException
public List<QueryResult> findSimpleQuery(String token, String statement) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findSimpleQuery
in interface SearchModule
statement
- The simple search in GQL language.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
http://jackrabbit.apache.org/api/1.6/org/apache/jackrabbit/commons/query/GQL.html
public ResultSet findSimpleQueryPaginated(String token, String statement, int offset, int limit) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findSimpleQueryPaginated
in interface SearchModule
statement
- The simple search in GQL language.offset
- Query result list offset.limit
- Query result list limit.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
http://jackrabbit.apache.org/api/1.6/org/apache/jackrabbit/commons/query/GQL.html
public ResultSet findMoreLikeThis(String token, String uuid, int maxResults) throws AccessDeniedException, RepositoryException, DatabaseException
SearchModule
findMoreLikeThis
in interface SearchModule
uuid
- Uuid of the document to find other similar.maxResults
- Maximum number of returned documents.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
Copyright © 2016. All rights reserved.