How to set hybridEnabled true in DbOrIndexSwitchingQueryLanguage alfresco solr?

cancel
Showing results for 
Search instead for 
Did you mean: 
devkinandanchau
Member II

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 the 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 fixes my problem or suggest anything else to resolve my use case?

3 Replies
afaust
Master

Re: How to set hybridEnabled true in DbOrIndexSwitchingQueryLanguage alfresco solr?

It looks like you have already looked into the source code, so you might have seen the property solr.query.hybrid.enabled used to configure to property you mentioned from the DbOrIndexSwitchingQueryLanguage class.

As far as I know, the HYBRID mode is not officially supported / recommended. In fact, the documentation even mentions that in the page about the admin console configuration page for SOLR.

devkinandanchau
Member II

Re: How to set hybridEnabled true in DbOrIndexSwitchingQueryLanguage alfresco solr?

If I use queryConsistency=EVENTUAL then it'll hit the Solr. 

If queryConsistency=HYBRID then it'll hit Solr and DB.

 

Is there any way to hit Solr first and if there are no results from Solr then it'll query the DB? 

afaust
Master

Re: How to set hybridEnabled true in DbOrIndexSwitchingQueryLanguage alfresco solr?

There is no such option and no way to do that, unless you were to completely replace the DbOrIndexSwitchingQueryLanguage implementation.