Jump to content

[Error] Search box don't work


Recommended Posts

Hi, I have version 1.5.3 of Prestashop and the search engine doesn't work.

I have tried various solutions proposed forum earlier but none works. The search don't find any products from my store. Any idea who might be failing?

 

I try some options of Preferences>Search

 

 

Thanks.

Link to comment
Share on other sites

Are you using any special character in descriptions/names for some of the ones which are not indexed' try setting to 0 the weight for everything but product names, then reindex, and add the other ones back one by one. You'll see which one is causing the problem...if that's not in the products' name!

Link to comment
Share on other sites

I check Console in Chrome and i don't have any error when I search. All request return 200 OK, but empty.

 

My products are in spanish. I setting to 0 the weight for everything but product names, but i don't retrieve any result when I search some product.

Link to comment
Share on other sites

I tried disable ajax and set all weight to 0 (except names of products) and after reindexing products and nothing. Search box don't return any result.

 

I created a new product and I tried one more time, and the same result.

 

Any idea more?

 

Thanks a lot.

Edited by tamara_gl (see edit history)
Link to comment
Share on other sites

The files are correct, in fact I made ​​a test: If I change the database to the original prestashop database search box works.

 

I believe that migrated my shop to prestashop, products fields have not completed and causes a failure in the search query. But I don't find what may be missing. I did migration by importing a csv prestashop tool.

Link to comment
Share on other sites

  • 2 weeks later...

Ok, after studying the flow of how indexes prestashop products, I have the following conclusion:

 

In classes / search.php

 

We use the following method:

 

 

 

protected static function getProductsToIndex($total_languages, $id_product = false, $limit = 50)

{

// Adjust the limit to get only "whole" products, in every languages (and at least one)

$max_possibilities = $total_languages * count(Shop::getShops(true));

$limit = max($max_possibilities, floor($limit / $max_possibilities) * $max_possibilities);

 

return Db::getInstance()->executeS('

SELECT p.id_product, pl.id_lang, pl.id_shop, pl.name pname, p.reference, p.ean13, p.upc,

pl.description_short, pl.description, cl.name cname, m.name mname

FROM '._DB_PREFIX_.'product p

LEFT JOIN '._DB_PREFIX_.'product_lang pl

ON p.id_product = pl.id_product

'.Shop::addSqlAssociation('product', 'p').'

LEFT JOIN '._DB_PREFIX_.'category_lang cl

ON (cl.id_category = product_shop.id_category_default AND pl.id_lang = cl.id_lang AND cl.id_shop = product_shop.id_shop)

LEFT JOIN '._DB_PREFIX_.'manufacturer m

ON m.id_manufacturer = p.id_manufacturer

WHERE product_shop.indexed = 0

AND product_shop.visibility IN ("both", "search")

'.($id_product ? 'AND p.id_product = '.(int)$id_product : '').'

LIMIT '.(int)$limit

);

}

 

In this method my variables have these values​​:

 

$limit = 50;

$max_possibilities = 112;

 

After that:

 

$limit = max($max_possibilities, floor($limit / $max_possibilities) * $max_possibilities);

 

My $limit = 1.

 

And then, the follow query have a LIMIT 1. And get a products only with first id_lang (id_lang = 1). If the limit is 4 get 4 a product with 4 languages.

 

Is a bug? or something in my database is wrong?

Link to comment
Share on other sites

  • 1 month later...

My search box doesn't work either. The company that input my products is asking for "the exact field name and value to set for that field" and "which database field to update". I am clueless. Please help.

 

Takia

shop.mylittletoychest.com (adult content)

Link to comment
Share on other sites

Amazing! I did speak with a tech rep at my hosting company this morning but she said she couldn't figure it out. Maybe she did better than she thought.

 

However, it doesn't work very well. I tried about 8 different searches, but only 3 returned results. How can I improve the accuracy?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...