• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Enhanced search variables

AndyB

Well-known member
#1
In my Similar Threads Plus add-on for XenForo 1.5 I used the following code:

PHP:
$esServerOption = XenForo_Application::get('options')->elasticSearchServer;

$host = $esServerOption['host'];          
          
$port = $esServerOption['port'];
          
$index = XenES_Api::getInstance()->getIndex();

I would like to get equivalent code for XF2.

Thank you.
 
Last edited:

AndyB

Well-known member
#2
Got it.

PHP:
$configArray = $options->xfesConfig;

$host = $configArray['host'];			

$port = $configArray['port'];
		
$index = $configArray['index'];