cancel
Showing results for 
Search instead for 
Did you mean: 

Change search engines

msalamon
Champ in-the-making
Champ in-the-making
someone else asked this question, but i don't think they really got a response.  If I wanted to utilize a different search engine than Lucene (FAST, Autonomy, etc.), is this:

(a) possible?
(b) difficult to do?
© is the API/artchitecture set up to allow this (just as it allows MySQL to be swapped out for another RDBMS)?

If it is possible, what is required of any search engine to make this work?
4 REPLIES 4

andy
Champ on-the-rise
Champ on-the-rise
Hi

The answer to all your questions is yes.

No one has done this as far as I know.

You can register different IndexerAndSearcher implementations for each store. You would have to implement this interface and the underlying IndexerSPI and SearchService. You would also need to think about how  the index implementation ties into transactions. The seacher implementation is selected by the bean below, in the core-services.context.xml




<!–                                                                               –>
    <!– Generic factory for making indexers and searchers for a given protol or store –>
    <!–                                                                               –>
    <bean id="indexerAndSearcherFactory" class="org.alfresco.repo.service.StoreRedirectorProxyFactory">
        <property name="proxyInterface">
            <value>org.alfresco.repo.search.IndexerAndSearcher</value>
        </property>
        <property name="defaultBinding">
            <ref bean="luceneIndexerAndSearcherFactory"></ref>
        </property>
        <property name="redirectedProtocolBindings">
            <map>
                <entry key="workspace">
                    <ref bean="luceneIndexerAndSearcherFactory"></ref>
                </entry>
                <entry key="versionStore">
                    <ref bean="luceneIndexerAndSearcherFactory"></ref>
                </entry>
            </map>
        </property>
    </bean>

Regards

Andy

rivarola
Champ on-the-rise
Champ on-the-rise
Hello Andy,

Setting a custom indexer and/or searcher is very easy this way. The problem is classes like ADMLuceneIndexerAndSearcherFactory or ADMLuceneIndexerImpl have all their attributes and many of their methods private. As a consequence we have to copy/paste all the source code in the custom class to implement a slightly different behaviour.
Do you think the code of these classes could be more "open" to allow customizations or do the private members reflect code that often changes ? Is JIRA the right place to provide a zero value contribution with just protected members instead of private ones ?

andy
Champ on-the-rise
Champ on-the-rise
Hi

If you can post the methods you think should be protected I will take a look. If you are replacing lucene then you should be starting from clean. May be there is stuff that should be pushed up into the abstract factory.

The search engine or wrapper serach implemenation will have to support  the lucene query API and path support etc as described on the wiki. We use this in many places (as we put off creating an abstact query language).

You will also need a new result set type etc ….

Andy

rivarola
Champ on-the-rise
Champ on-the-rise
Hi Andy,

I do not want to replace Lucene (maybe later but not now). So the syntax is not a problem. I only changed a few things to index in a slightly different way  the categorisation using my own category nodes (which extend yours) and had to copy the whole class because nearly all fields are package-visible and many methods are private.
I'll try to isolate the needed members.
Thanks,

  Philippe