jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Atul Kumar Tripathi" <Atulkum...@virtusa.com>
Subject How to store indexes in mssql database
Date Sat, 07 Aug 2010 11:18:05 GMT
Hi,

 

I have problem in storing search indexes in database.

 

I am creating jackrabbit repository programmatically instead of using
xml configuration. I am able to store my content/data  and versioning
information in MS SQL SERVER 2005 database but indexes are still being
stored in file system even though I use FileSystemFactory (which creates
org.apache.jackrabbit.core.fs.db.MSSqlFileSystem instance),
org.apache.jackrabbit.core.data.db.DbDataStore and
org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceManager in
repository and workspace configuration.

 

FileSystemFactory which returns me MSSqlFileSystem is being used for
SearchConfig also.

 

Environment: 

JackRabbit 1.6.0 
Lucene 2.4.1 
JDK 6, 
Apache Tomcat 6_0_20 
MS SQL SERVER 2005 

 


Below is the code snippet: 

// Method to get FileSystemFactory which creates instance of
MSSqlFileSystem 

FileSystemFactory getFileSystem() { 


.......................... ....................................
......................... ....................................


return new FileSystemFactory() { 
            public FileSystem getFileSystem() throws RepositoryException
{ 




Properties parameters = new Properties(); 

parameters.put("url",getUrl()); 
parameters.put("user", getUserName()); 
parameters.put("password", getPassword()); 
parameters.put("schema", mssql); 
parameters.put("driver", getDriver()); 
parameters.put("schemaObjectPrefix", "JR_"); 

String fileSystemClass =
"org.apache.jackrabbit.core.fs.db.MSSqlFileSystem" 

BeanConfig config = new BeanConfig(fileSystemClass, parameters); 
FileSystem fileSystem = (FileSystem) config.newInstance(); 
fileSystem.init(); 

} 

 

} 

// Method to get SearchConfig 

SearchConfig getSearchConfig(FileSystemFactory fileSystemFactory ) { 




String searchIndexClass =
"org.apache.jackrabbit.core.query.lucene.SearchIndex"; 
Properties params = new Properties(); 
params.put("path", getIndexPath()); 
params.put("textFilterClasses", .....................); 
params.put("analyzer", ....................); 
params.put("queryClass", ...............); 
.................... 
....................... 

return new SearchConfig(searchIndexClass , params, fileSystemFactory ); 



} 

void createRepository()

{ 




FileSystemFactory fileSystem = getFileSystem(); 
searchConfig = getSearchConfig(fileSystem); 

RepositoryConfig repositoryConfig = new RepositoryConfig(repoPath,
securityConfig, fileSystem, workspaceDirectory, 
                null, defaultWorkspace, maxIdleTime, wsElement,
versioningConfig, searchConfig, null, dataStoreFactory,
LockMechanismFactory, repositoryConfigurationParser); 
repositoryConfig.init(); 
JackrabbitRepository repository =
RepositoryImpl.create(repositoryConfig); 




} 




Is this possible to store indexes in database using jackrabbit 1.6 or
some higher version? 

 

Any help would be highly appreciated.

Thanks & Regards. 

Atul Tripathi


---------------------------------------------------------------------------------------------

This message, including any attachments, contains confidential information intended for a
specific individual and purpose, and is intended for the addressee only. Any unauthorized
disclosure, use, dissemination, copying, or distribution of this message or any of its attachments
or the information contained in this e-mail, or the taking of any action based on it, is strictly
prohibited. If you are not the intended recipient, please notify the sender immediately by
return e-mail and delete this message.

---------------------------------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message