Package org.fcrepo.search.impl
Class DbSearchIndexImpl
- java.lang.Object
-
- org.fcrepo.search.impl.DbSearchIndexImpl
-
- All Implemented Interfaces:
SearchIndex
@Component("searchIndexImpl") public class DbSearchIndexImpl extends Object implements SearchIndex
An implementation of theSearchIndex
- Author:
- dbernstein, whikloj
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID_COLUMN
static String
RDF_TYPE_ID_COLUMN
static String
RDF_TYPE_URI_PARAM
static String
RESOURCE_SEARCH_ID_PARAM
static String
SEARCH_RDF_TYPE_TABLE
static String
SEARCH_RESOURCE_RDF_TYPE_TABLE
static String
TRANSACTION_ID_PARAM
-
Constructor Summary
Constructors Constructor Description DbSearchIndexImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUpdateIndex(Transaction transaction, ResourceHeaders resourceHeaders)
Adds or updates the index with the resource header information.void
commitTransaction(Transaction tx)
Commit the changes made in the transaction.SearchResult
doSearch(SearchParameters parameters)
Performs a search based on the parameters and returns the result.void
removeFromIndex(Transaction transaction, FedoraId fedoraId)
Removes indexed fields associated with the specified Fedora IDvoid
reset()
Remove all persistent state associated with the index.void
rollbackTransaction(Transaction tx)
Rollback the changes in the transaction.void
setup()
Setup database table and connection
-
-
-
Field Detail
-
SEARCH_RESOURCE_RDF_TYPE_TABLE
public static final String SEARCH_RESOURCE_RDF_TYPE_TABLE
- See Also:
- Constant Field Values
-
SEARCH_RDF_TYPE_TABLE
public static final String SEARCH_RDF_TYPE_TABLE
- See Also:
- Constant Field Values
-
RDF_TYPE_ID_COLUMN
public static final String RDF_TYPE_ID_COLUMN
- See Also:
- Constant Field Values
-
ID_COLUMN
public static final String ID_COLUMN
- See Also:
- Constant Field Values
-
RDF_TYPE_URI_PARAM
public static final String RDF_TYPE_URI_PARAM
- See Also:
- Constant Field Values
-
RESOURCE_SEARCH_ID_PARAM
public static final String RESOURCE_SEARCH_ID_PARAM
- See Also:
- Constant Field Values
-
TRANSACTION_ID_PARAM
public static final String TRANSACTION_ID_PARAM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DbSearchIndexImpl
public DbSearchIndexImpl()
-
-
Method Detail
-
setup
@PostConstruct public void setup()
Setup database table and connection
-
doSearch
public SearchResult doSearch(SearchParameters parameters) throws InvalidQueryException
Description copied from interface:SearchIndex
Performs a search based on the parameters and returns the result.- Specified by:
doSearch
in interfaceSearchIndex
- Parameters:
parameters
- The parameters defining the search- Returns:
- The result of the search
- Throws:
InvalidQueryException
-
addUpdateIndex
public void addUpdateIndex(Transaction transaction, ResourceHeaders resourceHeaders)
Description copied from interface:SearchIndex
Adds or updates the index with the resource header information.- Specified by:
addUpdateIndex
in interfaceSearchIndex
- Parameters:
transaction
- The externally generated transaction.resourceHeaders
- The resource headers associated with the resource
-
removeFromIndex
public void removeFromIndex(Transaction transaction, FedoraId fedoraId)
Description copied from interface:SearchIndex
Removes indexed fields associated with the specified Fedora ID- Specified by:
removeFromIndex
in interfaceSearchIndex
- Parameters:
transaction
- The transactionfedoraId
- The Fedora ID
-
reset
public void reset()
Description copied from interface:SearchIndex
Remove all persistent state associated with the index.- Specified by:
reset
in interfaceSearchIndex
-
commitTransaction
public void commitTransaction(Transaction tx)
Description copied from interface:SearchIndex
Commit the changes made in the transaction.- Specified by:
commitTransaction
in interfaceSearchIndex
- Parameters:
tx
- The transaction .
-
rollbackTransaction
@Transactional(propagation=NOT_SUPPORTED) public void rollbackTransaction(Transaction tx)
Description copied from interface:SearchIndex
Rollback the changes in the transaction.- Specified by:
rollbackTransaction
in interfaceSearchIndex
- Parameters:
tx
- The transaction.
-
-