Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add API-call for search_result table #540

Closed
phaidon opened this Issue · 3 comments

4 participants

@phaidon
Owner

Why does the search plugin has not api-call to add search results? IMHO It is not very elegant that the modules has to do queries to the search result table. Here an example from the Pages module:

$searchTable = $table['search_result'];
...
$insertSql =
                "INSERT INTO $searchTable
                ($searchColumn[title],
                $searchColumn[text],
                $searchColumn[extra],
                $searchColumn[created],
                $searchColumn[module],
                $searchColumn[session])
                VALUES ";
...
$sql = $insertSql . '('
                    . '\'' . DataUtil::formatForStore($obj['title']) . '\', '
                    . '\'' . DataUtil::formatForStore($obj['content']) . '\', '
                    . '\'' . DataUtil::formatForStore($extra) . '\', '
                    . '\'' . DataUtil::formatForStore($obj['cr_date']) . '\', '
                    . '\'' . 'Pages' . '\', '
                    . '\'' . DataUtil::formatForStore($sessionId) . '\')';
            $insertResult = DBUtil::executeSQL($sql);

@drak

@ghost

There is a lot of room for improvement with the Search module.

@cmfcmf
Owner

I'm closing this one as @craigh remade the search some time ago. Example of current implementation: https://github.com/craigh/ExtensionLibrary/blob/master/Zikula/Module/ExtensionLibraryModule/Helper/SearchHelper.php#L48-L68.

@cmfcmf cmfcmf closed this
@Guite Guite modified the milestone: 1.4.0, 2.0.0
@craigh
Owner

:+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.