Search join title and subtitle in the titleField of my site search engine

3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 10, 2022   (RSS)

By daniel - February 10, 2022

Hi Zicky,

With the multi-search, "titleField" can only be a single field. If you'd like to include the subtitle in the results, you could add it as one of the additional returned fields like this:

$searchTables['news'] = array(
 'viewerUrl'       => 'news-article.php',
 'titleField'      => 'title',
 'summaryField'    => 'content',
 'searchFields'    =>  array('title','summary','content','keywords','categories'),
 'field1'       => 'createdDate',
 'field2'       => 'subtitle',
);

Then in the results, the "field2" key should include the subtitle and can be output alongside "_title". 

Let me know if that helps or if you have any other questions!

Thanks,

Daniel
Technical Lead
interactivetools.com

By Mikey - February 10, 2022

Thank you Daniel!!