searchKeywordContent.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. require_once('./inc/header.inc.php');
  10. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  11. if (bx_get('keyword')){
  12. bx_import('BxDolLanguages');
  13. $sClass = 'BxDolSearch';
  14. $sElsName = 'bx_elasticsearch';
  15. $sElsMethod = 'is_configured';
  16. if(BxDolRequest::serviceExists($sElsName, $sElsMethod) && BxDolService::call($sElsName, $sElsMethod)) {
  17. $oModule = BxDolModule::getInstance($sElsName);
  18. bx_import('Search', $oModule->_aModule);
  19. $sClass = 'BxElsSearch';
  20. }
  21. $o = new $sClass(bx_get('section'));
  22. $o->setLiveSearch(bx_get('live_search') ? 1 : 0);
  23. $o->setMetaType(bx_process_input(bx_get('type')));
  24. $o->setCategoryObject(bx_process_input(bx_get('cat')));
  25. $s = $o->response();
  26. if (!$s)
  27. $s = $o->getEmptyResult();
  28. header('Content-type: text/html; charset=utf-8');
  29. echo $s;
  30. }
  31. /** @} */