Jump to content

[solved] Search is not working


Recommended Posts

I've noticed something:

I use Romanian language for my front office.

Before adding more categories and subcategories, i deactivated the English language from the BO.
The categories and subcategories were added while the English language was deactivated.

Now, when i have only Romanian language active on the front office, the search is not working.

When i have both English and Romanian languages active, the search works only when i select the English language. Also, when English is selected, i see only the default PrestaShop categories, and the ones i added do not appear.

Look forward to getting some help on this!

Thank you!

Link to comment
Share on other sites

I solved this one:
- You must have at least 2 languages active on the BO.
- After you have that, go to the product's page and right next to its name you will see the language flags.
- Click on the desired flag and a popup will appear.
- Select the desired flag (the language will be on the frontpage) and then click "save" in the bottom of the page.

After you have done that, the search should work in the language you just selected (when you clicked that flag i was telling you above).

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...
  • 2 months later...

I had the same problem, after some searching I found out that the search-index is not complete, just rebuild it:

 

 

Go into your back office, select Preferences->Search.

You should see a section called Indexation (sp)

click Re-build entire index.

 

That should fix your problems, just for all the people who got the same problem.

  • Like 5
  • Haha 1
Link to comment
Share on other sites

  • 1 month later...

I am using version 1.4.7 too, but FO search doesn't work. I tried:

- re-build entire index

- set 2 languages: vn(default), en

- replace the file search.php by the newest version 1.4.8.2

- build a local server for testing

- change themes

 

but unsuccessful.

 

FO search give wrong results but BO search works perfectly.

 

I think something wrong at the function sanitize() in the file /classes/search.php

 

Thanks,

Thienxu

Link to comment
Share on other sites

  • 2 months later...

I am experiencing a similar problem and still have not been able to find a solution. The quick search brings up a blank page no matter what word I use in search. I tried above solutions (lang tag and re-build entire index); version 1.4.8.2

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

my post is deleted.

yesterday i have post that i am facing same problem.

 

Ok here is again..

 

I am getting same issue in my site http://www.slmobileprice.com , in my site only some products showing in search box mainly newly added or edited product. but not old product while they are in product list. I have rebuild index but nothing happened, getting same issue. you can check in my site, and search Sony xperia Z or Sony xperia Z1, but you can not search, But these products available in Category "Mobile  - Sony ". Please reply me solution.

 

Thanks in advance :-)

Link to comment
Share on other sites

somits1, I believe you have the minimum search word length set to the default of 3. This means that the Z and Z1 will be ignored and all Sony xperia products will be returned in the search results.

If you set it to 2 and then reindex, the search for the Z1 should just return that product (but the search for the Z will again return all the xperias).

Cheers, Dave

Link to comment
Share on other sites

  • 2 months later...

Can anyone from prestashop help please, I am currently running 1.4.4.1, the search function was never worked at all from the first place when I bought it.

 

I have tried all methods stated here, but none of them work, my site is http://www.epos.ecig380.com/

 

And my back office settings are as follows... https://www.dropbox.com/s/i9140cgr4y4gfcl/Screenshot%202014-05-16%2022.08.15.png

 

Please advise what have I done wrong...?

 

 

post-721100-0-76520400-1400274651_thumb.png

Link to comment
Share on other sites

  • 10 months later...

you can change in classes/search.php

and change
query.

before :

$intersect_array[] = 'SELECT si.id_product
                    FROM '._DB_PREFIX_.'search_word sw
                    LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word
                    WHERE sw.id_lang = '.(int)$id_lang.'
                        AND sw.id_shop = '.$context->shop->id.'
                        AND sw.word LIKE
                    '.($word[0] == '-'
                        ? ' \''.$start_search.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'\''
                        : ' \''.$start_search.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'\''
                    );

                if ($word[0] != '-')
                    $score_array[] = 'sw.word LIKE \''.$start_search.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'';

 

after:

$intersect_array[] = 'SELECT DISTINCT(pl.id_product)
                    FROM '._DB_PREFIX_.'product_lang pl
                    WHERE pl.id_shop = '.$context->shop->id.'
                        AND pl.name LIKE
                    '.($word[0] == '-'
                        ? ' \''.$start_search.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\''
                        : ' \''.$start_search.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''
                    );

                if ($word[0] != '-')
                    $score_array[] = 'pl.name LIKE \''.$start_search.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'';

 

 

 

Link to comment
Share on other sites

  • 1 month later...

I had the same problem, after some searching I found out that the search-index is not complete, just rebuild it:

 

 

Go into your back office, select Preferences->Search.

You should see a section called Indexation (sp)

click Re-build entire index.

 

That should fix your problems, just for all the people who got the same problem.

Thank you in advance for this solution, this is awesome

Link to comment
Share on other sites

  • 2 years later...
  • 4 months later...
On 22/09/2017 at 10:02 PM, goldensite.ro said:

Cum ai făcut ca rezultatele de cautare să lucreze atat de bine? http://www.magazinoutdoor.ro/cautare?controller=search&orderby=position&orderway=desc&search_query=camasa+hart&submit_search=

La mine nu merge de loc, imi afiseaza numai aberatii pe presta 1.7

 

Salut. Ai reusit sa rezolvi cu cautarea? Nici mie nu-mi merge.

Link to comment
Share on other sites

  • 10 months later...

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...