Magento Forum

How to find product with exact match in magento quick search
 
zahdiur34
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2011-03-28
 

Hi,
I want to show exact product when i use magento quick search
When i search with quick search in magento using ‘Sony VAIO 11.1” Notebook PC’ i get almost 12 result but i should the get exact product only 1, I have activated just title in quick search
Would anyone suggest me how i can show it.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Template fans
Guru
 
Total Posts:  446
Joined:  2009-11-02
 

It’s better to have more search results.  Why do you want to have the exact one?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

Hi, zahdiur34.

At the moment magento splits the search query and show products which have at least one of the words.

You need to modify line 342 (for CE1.4.2) of the Mage_CatalogSearch_Model_Mysql4_Fulltext

if ($like{
                    $likeCond 
'(' join(' OR '$like) . ')';
                
}
and change “OR” with “AND”

Let me know if it helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nara123
Sr. Member
 
Total Posts:  89
Joined:  2010-08-24
 

Hi Amasty,
Thank you very much.

It was exactly what I am looking for, you are a star!

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
zahdiur34
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2011-03-28
 

Hi Template fans,
It’s working. Thank you very much.
Zahid

 
Magento Community Magento Community
Magento Community
Magento Community
 
haligonia
Sr. Member
 
Total Posts:  97
Joined:  2009-02-28
 

I am having similar issues with Magento quick search. I used to run 1.3.* and on this website the catalog search would include meta keywords. So I could include possible words that people would search for in the meta keywords without them being visible in the product description.

Now I am running 1.4.2 and the catalog search seems to be blind to any meta keywords I include. Can anybody tell me how to make the search include the meta keywords for the individual products?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tai Liu
Jr. Member
 
Total Posts:  2
Joined:  2010-10-17
 
Amasty - 30 April 2011 06:57 AM

Hi, zahdiur34.

At the moment magento splits the search query and show products which have at least one of the words.

You need to modify line 342 (for CE1.4.2) of the Mage_CatalogSearch_Model_Mysql4_Fulltext

if ($like{
                    $likeCond 
'(' join(' OR '$like) . ')';
                
}
and change “OR” with “AND”

Let me know if it helps.

This one works. I just changed mine on 1.5 version. Thanks.
Tai.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rocket Web
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2010-01-19
Naperville, IL
 

We have some more involved solutions to this problem in the works.  I’d love to get some brief feedback on some search problems you guys experience in your store.  Please checkout my post on improving magento search.  If you’ve got 1 minute to submit the form it would be very helpful in our extension development.  If you leave your name and email, we’ll be in touch when our extension goes live.

-Matt
magento developer

 
Magento Community Magento Community
Magento Community
Magento Community
 
croman
Jr. Member
 
Total Posts:  9
Joined:  2010-10-08
 

Hello,

i was searching 2 days for a solution to solve the same problem on quicksearch.
Thanks many for this tip to change the query string from OR to AND.

I am on Magento 1.6.2.0 so the file to change it was found at:

/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php

on line 355 -->

if ($like{
                    $likeCond 
'(' join(' AND '$like) . ')';
                
}

and on line 377 -->

if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE{
                    $where 
.= ($where ' AND ' '') . $likeCond;
            
}

ON Admin configuration system katalog i set the search operation to LIKE, i think it works also with FULLTEXT-search.

Please rebuild the index and empty all cache…

 
Magento Community Magento Community
Magento Community
Magento Community
 
thylaksoft
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2009-12-10
New Castle, DE
 

Just go to the following path
System->Configuration->Catalog->Catalog Search
and select the search type for Fulltext.

Thylaksoft LLC

http://www.thylaksoft.com
302-355-0449

 
Magento Community Magento Community
Magento Community
Magento Community
 
shahi2k2
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2010-08-27
 

This is the best solution for getting the quick search working for exact search.

Just change the ‘OR’ factor to ‘AND’

croman - 01 March 2012 03:01 AM

Hello,

i was searching 2 days for a solution to solve the same problem on quicksearch.
Thanks many for this tip to change the query string from OR to AND.

I am on Magento 1.6.2.0 so the file to change it was found at:

/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php

on line 355 -->

if ($like{
                    $likeCond 
'(' join(' AND '$like) . ')';
                
}

and on line 377 -->

if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE{
                    $where 
.= ($where ' AND ' '') . $likeCond;
            
}

ON Admin configuration system katalog i set the search operation to LIKE, i think it works also with FULLTEXT-search.

Please rebuild the index and empty all cache…
 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

Hi
In fact, Magenta search is not perfect. Very often a user doesn’t find what he was looking for and leaves the store. Good decision is to integrate the Sphinx search engine. It greatly improves the quality and relevance of search results. Look at http://mirasvit.com/magento-extensions/magento-sphinx-search.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
haloway
Jr. Member
 
Total Posts:  1
Joined:  2013-03-13
 

No customer will search exactly only one product on your website. I think

New site: waterproof case

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top