【问题标题】:Catalog search not working completely目录搜索不完全工作
【发布时间】:2014-07-30 12:33:24
【问题描述】:

我知道这看起来像是重复的,但我找到的解决方案都没有解决我的错误

例如,我的产品名称为“棒球帽”且 SKU = 123456。当我搜索“棒球”或“123456”时,我会得到结果。但是当我搜索“base”或“1234”(只是名称或 sku 的一部分)时,它就不起作用了。

我做了什么:

  1. 检查了产品数量、知名度、价格、可用性,并且测试的产品属于类别(不仅仅是根类别)并且一切似乎都很好。

  2. System->Configuration->Catalog 并检查 Catalog Search 中的 Search Type 字段是否为 Like。也不适用于组合(点赞和全文)

  3. 清除缓存并重新索引

  4. 目录->管理产品->更新主网站的属性

还是不行……

我真的没有任何其他想法,我真的很需要。

我使用的是 Enterprise 1.12.0.2

正如 zhartaunik 所建议的,这是我在使用有效的查询(例如 baseball)进行搜索时得到的查询输出:

SELECT 1 AS 'status', 'e'.'entity_id', 'e'.'type_id', 'e'.'attribute_set_id', 'e'.'name', 'e'.'short_description', 'e'.'sku', 'e'.'price', 'e'.'special_price', 'e'.'special_from_date', 'e'.'special_to_date', 'e'.'small_image', 'e'.'thumbnail', 'e'.'color', 'e'.'color_value', 'e'.'news_from_date', 'e'.'news_to_date', 'e'.'url_key', 'e'.'required_options', 'e'.'image_label', 'e'.'small_image_label', 'e'.'thumbnail_label', 'e'.'msrp_enabled', 'e'.'msrp_display_actual_price_type', 'e'.'msrp', 'e'.'tax_class_id', 'e'.'price_type', 'e'.'weight_type', 'e'.'price_view', 'e'.'shipment_type', 'e'.'links_purchased_separately', 'e'.'links_exist', 'e'.'giftcard_amounts', 'e'.'allow_open_amount', 'e'.'open_amount_min', 'e'.'open_amount_max', 'e'.'customizable', 'e'.'is_cargo', 'e'.'minimum_quantity', 'e'.'super_price', 'e'.'label_sale', 'e'.'size', 'e'.'size_value', 'e'.'bestseller', 'e'.'favorite_present', 'e'.'manufacturer', 'e'.'manufacturer_value', 'e'.'favorite_present_position', 'e'.'sort', 'e'.'is_promoset', 'e'.'promoset_parts', 'e'.'promoset_product', 'e'.'promoset_options', 'e'.'promoset_benefits', 'e'.'is_firework', 'e'.'is_bulky', 'e'.'flavour', 'e'.'flavour_value', 'e'.'printed_order_number', 'e'.'ordernumber', 'e'.'customizableonly', 'search_result'.'relevance', 'price_index'.'price', 'price_index'.'tax_class_id', 'price_index'.'final_price', IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS 'minimal_price', 'price_index'.'min_price', 'price_index'.'max_price', 'price_index'.'tier_price', 'cat_index'.'position' AS 'cat_index_position' FROM 'catalog_product_flat_4' AS 'e'
 INNER JOIN 'catalogsearch_result' AS 'search_result' ON search_result.product_id=e.entity_id AND search_result.query_id='188'
 INNER JOIN 'catalog_product_index_price' AS 'price_index' ON price_index.entity_id = e.entity_id AND price_index.website_id = '2' AND price_index.customer_group_id = 0
 INNER JOIN 'catalog_category_product_index' AS 'cat_index' ON cat_index.product_id=e.entity_id AND cat_index.store_id='4' AND cat_index.visibility IN(3, 4) AND cat_index.category_id='92' ORDER BY 'relevance' desc LIMIT 12

【问题讨论】:

    标签: php magento


    【解决方案1】:

    请插入文件:

    对于默认的 1.9 magento

    \app\design\frontend\rwd\default\template\catalog\product\list.phtml

    否则,请输入您的主题名称和您的包 rwd\默认

    行后 $_productCollection=$this->getLoadedProductCollection();

    以下代码:

    Mage::log($_productCollection->getSelectSQL(1), false, 'search-query.log', true);
    

    运行搜索并从文件 /var/log/search-query.log 中复制您的查询。

    【讨论】:

    • 如果我使用base(不存在的词查询)进行搜索,它不会生成“search-query.log”。但是,当我使用 baseball 搜索时,它会生成它(在这种情况下搜索有效)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-09
    • 1970-01-01
    • 2014-07-17
    • 1970-01-01
    • 1970-01-01
    • 2014-08-22
    相关资源
    最近更新 更多