Search code examples
solralfresco

How to set hybridEnabled true in DbOrIndexSwitchingQueryLanguage alfresco solr?


Using Alfresco Community - 5.0.0 version.

Use Case : For fetching documents we want to query Solr first then DB.

First I've tried below properties in alfresco-global.properties file:

solr.query.cmis.queryConsistency=EVENTUAL
solr.query.fts.queryConsistency=EVENTUAL

After above changes, i was able to see logs that it was using Solr to execute Query and getting all the documents. But for some specific query, it returned no records.

So, for fixing above specific scenario, I've changed these from EVENTUAL to HYBRID.

solr.query.cmis.queryConsistency=HYBRID
solr.query.fts.queryConsistency=HYBRID

After these changes, there were no logs related to Solr or DB query and not getting any documents on UI.

After seeing the code of the DbOrIndexSwitchingQueryLanguage class, found that hybridEnabled attribute should be true for executing this case.

Can anybody suggest me how to set hybridEnabled true if this fix my problem or suggest anything else to resolve my use case ?


Solution

  • You should set solr.query.hybrid.enabled=true property for HYBRID searching.

    Pls see:
    https://github.com/Alfresco/alfresco-repository/blob/ac38ac94ff4f9cbdf2671a9517781bda389a13c4/src/main/resources/alfresco/subsystems/Search/common-search-context.xml