简体   繁体   English

在Magento中哪里可以找到搜索词插入查询

[英]Where to find search term insert query in magento

How magento insert search term in to database. magento如何在数据库中插入搜索词。 Where can i find insert query. 在哪里可以找到插入查询。 Please mention the path of file that include the search term insert query. 请提及包含搜索词插入查询的文件的路径。

Open app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php 打开app / code / core / Mage / Adminhtml / controllers / Catalog / SearchController.php

and find: 并找到:

public function saveAction()

Here you will find complete code to insert search terms. 在这里,您将找到插入搜索词的完整代码。

Please let me know if I was able to answer your question. 如果我能够回答您的问题,请告诉我。

What you are looking for will vary slightly depending on the version of your Magento and on your settings. 根据Magento的版本和设置,您要寻找的内容会略有不同。 If you are using Magento CE 1.7.x. 如果您使用的是Magento CE1.7.x。 or higher and use typical settings (close to default) the insert of the search term and the actual results are saved together and the code can be seen in: 或更高版本,并使用典型设置(接近默认设置)将搜索词的插入内容和实际结果保存在一起,并且可以在以下代码中看到代码:

class: Mage_CatalogSearch_Model_Resource_Fulltext 类: Mage_CatalogSearch_Model_Resource_Fulltext

file: /app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php 文件: /app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php

method: public function prepareResult($object, $queryText, $query) 方法: public function prepareResult($object, $queryText, $query)

Look at lines 365-370: 查看第365-370行:

    $sql = $adapter->insertFromSelect($select,
        $this->getTable('catalogsearch/result'),
        array(),
        Varien_Db_Adapter_Interface::INSERT_ON_DUPLICATE);
    $adapter->query($sql, $bind);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM