We are building the application that needs to support Salesforce Classic Knowledge and Lightning Knowledge. As you might know these two knowledge types are not compatible between each other. In Classic Knowledge we work with ArticleTypes but in Lightning Knowledge with RecordTypes.
Enabling Lightning Knowledge changes your Org's Data Model to use Record Types rather than Article Types. Orgs with multiple articles types require data migration to consolidate article types before enabling Lightning Knowledge. IMPORTANT: After you enable Lightning Knowledge, you can't disable it. Test in a Sandbox or Trial org before enabling in production. https://help.salesforce.com/articleView?id=knowledge_lightning_enable.htm&type=0
Therefore we need to implement two different implementation of the logic (search).
But how to identify what type of Knowledge is enabled in the organization via Apex code? I've checked all Apex Classes related to Apex and didn't find anything that can answer this question.