Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add API-call for search_result table #540

Closed
phaidon opened this Issue Oct 18, 2012 · 3 comments

Comments

Projects
None yet
4 participants
Contributor

phaidon commented Oct 18, 2012

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

ghost commented Oct 18, 2012

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

Owner

cmfcmf commented Jun 30, 2014

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 Jun 30, 2014

@Guite Guite modified the milestones: 1.4.0, 2.0.0 Jun 30, 2014

Owner

craigh commented Jun 30, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment