You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Gary Dong <ga...@gmail.com> on 2007/06/08 00:00:18 UTC

Persistence SearchIndex to database

Hi;

I'm using oracle as my repository. I'm think also persistence the search
index to the database. I got two question on that.

1. Is that a good idea to also persistence the search index to the database?

2. Assume it is a feasible idea. I configured the <SearchIndex> element by
provide a <FileSystem> which is configured as OracleFileSystem in my
<Workspace> configuration as below. When I run the application  I noticed
that the  search index is still on local file system.

Can anyone tell how I can persistence search index in the database?
<Workspace name="default">
        <!--
            virtual file system of the workspace:
            class: FQN of class implementing the FileSystem interface
        -->
        <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem
">
            <param name="url" value="jdbc:oracle:thin:@dendbd2
:1547:dcn1adev"/>
            <param name="user" value="user"/>
            <param name="password" value="user"/>
            <param name="schemaObjectPrefix" value="ws_file_"/>
        </FileSystem>
        <!--
            persistence manager of the workspace:
            class: FQN of class implementing the PersistenceManager
interface
        -->
        <PersistenceManager class="
org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
            <param name="externalBLOBs" value="false"/>
            <param name="bundleCacheSize" value="8"/>
            <param name="consistencyCheck" value="false"/>
            <param name="minBlobSize" value="16384"/>
            <param name="driver" value="oracle.jdbc.OracleDriver"/>
            <param name="url" value="jdbc:oracle:thin:@dendbd2
:1547:dcn1adev"/>
            <param name="user" value="user"/>
            <param name="password" value="user"/>
            <param name="schema" value="oracle"/>
            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
        </PersistenceManager>
        <!--
            Search index and the file system it uses.
            class: FQN of class implementing the QueryHandler interface
        -->

        <SearchIndex class="
org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/ws_gary_index"/>
            <FileSystem class="
org.apache.jackrabbit.core.fs.db.OracleFileSystem">
                <param name="url" value="jdbc:oracle:thin:@dendbd2
:1547:dcn1adev"/>
                <param name="user" value="user"/>
                <param name="password" value="user"/>
                <param name="schemaObjectPrefix" value="${wsp.name
}_index_"/>
            </FileSystem>
        </SearchIndex>

    </Workspace>




Thank you for the help ahead.

Gary

Re: Persistence SearchIndex to database

Posted by Marcel Reutegger <ma...@gmx.net>.
Stefan Guggisberg wrote:
> random access is supported by the FileSystem abstraction:
> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/fs/FileSystemResource.html#getRandomAccessOutputStream() 

we'd also need that for the 'InputStream'.

regards
  marcel

Re: Persistence SearchIndex to database

Posted by Stefan Guggisberg <st...@gmail.com>.
On 6/11/07, Marcel Reutegger <ma...@gmx.net> wrote:
> Gary Dong wrote:
> > 2. Assume it is a feasible idea. I configured the <SearchIndex> element by
> > provide a <FileSystem> which is configured as OracleFileSystem in my
> > <Workspace> configuration as below. When I run the application  I noticed
> > that the  search index is still on local file system.
> >
> > Can anyone tell how I can persistence search index in the database?
>
> this is currently not possible. there once was an implementation that used the
> FileSystem abstraction, but it was removed again because the performance was
> bad. for certain operations the lucene query handler reads from the index files
> in a random access fashion, which is not possible with the FileSystem API.

random access is supported by the FileSystem abstraction:
http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/fs/FileSystemResource.html#getRandomAccessOutputStream()

the problem is implementing this feature efficiently using a database backend.

cheers
stefan


>
> please file a jira issue if you wish to see this implemented.
>
> regards
>   marcel
>

Re: Persistence SearchIndex to database

Posted by Marcel Reutegger <ma...@gmx.net>.
Gary Dong wrote:
> 2. Assume it is a feasible idea. I configured the <SearchIndex> element by
> provide a <FileSystem> which is configured as OracleFileSystem in my
> <Workspace> configuration as below. When I run the application  I noticed
> that the  search index is still on local file system.
> 
> Can anyone tell how I can persistence search index in the database?

this is currently not possible. there once was an implementation that used the 
FileSystem abstraction, but it was removed again because the performance was 
bad. for certain operations the lucene query handler reads from the index files 
in a random access fashion, which is not possible with the FileSystem API.

please file a jira issue if you wish to see this implemented.

regards
  marcel

Re: Persistence SearchIndex to database

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

[Please don't cross-post across users@ and dev@. I'm responding just on users@.]

On 6/8/07, Gary Dong <ga...@gmail.com> wrote:
> I'm using oracle as my repository. I'm think also persistence the search
> index to the database. I got two question on that.
>
> 1. Is that a good idea to also persistence the search index to the database?

It might be a good idea (see my previous messages on users@), but at
the moment it is not possible in Jackrabbit.

> 2. Assume it is a feasible idea. I configured the <SearchIndex> element by
> provide a <FileSystem> which is configured as OracleFileSystem in my
> <Workspace> configuration as below. When I run the application  I noticed
> that the  search index is still on local file system.

Even though the configuration format allows you to specify a
<FileSystem> for a <SearchIndex>, the current
org.apache.jackrabbit.core.query.lucene.SearchIndex class
unfortunately ignores any such virtual filesystem configurations for
performance reasons.

BR,

Jukka Zitting