Sign up |
This is our search code.
<form method="POST" action="searchResults.php">
<input name="title,intro_keyword" type="text" value="" size="16">
<input type="submit" name="submit" value="Search">
It will display all related keywords on the searchResults.php page.
I have no idea how the search results sorting .
What is the sorting rule?
Is it possible to change?
Thanks a lot!
I guess you're using the getRecords function to retrieve your results? If so you can add an orderBy variable to it's array to decide what order the results are displayed in:
// load records from 'blog'
list($blogRecords, $blogMetaData) = getRecords(array(
'tableName' => 'blog',
'loadUploads' => true,
'allowSearch' => true,
'orderBy' => "title, content DESC"
The orderBy variable should contain a MySQL ORDER BY string. You can read about it here:
By default the function will order the results by what you have set in the sections settings. (See attached screen shot).