XF 2.0 XFES update data

AndyB

Well-known member
In some of my add-ons I need to update the data in Enhanced search. In XF1 the following code was used:

PHP:
XenES_Api::index($indexName, $contentType, $contentId, $record);

Is there similar code for XF2.

Thank you.
 
The supported solution is on a search handler implement the setupMetadataStructure method;
PHP:
    public function setupMetadataStructure(MetadataStructure $structure)
    {
        $structure->addField('conversation', MetadataStructure::INT);
        $structure->addField('recipients', MetadataStructure::INT);
    }

This way search will correctly function on Elastic Search 6+ and Elastic Search 5 and older.
 
Back
Top Bottom