10-18-2018 07:02 AM
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?
10-18-2018 07:46 AM
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.
10-23-2018 07:32 AM
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?
10-24-2018 06:45 AM
There is no such option and no way to do that, unless you were to completely replace the DbOrIndexSwitchingQueryLanguage implementation.
Explore our Alfresco products with the links below. Use labels to filter content by product module.