6 votes
Accepted

Searching for SKU without special characters

To make this work for both, the real SKU and the one without -, both have to be added to catalogsearch_result table because SQL-query for search results looks like this: SELECT `s`.`product_id`, 0 AS ...
sv3n's user avatar
  • 11.7k
6 votes

How do I change Magento 2 search from OR logic to AND?

I found the solution , create a file search_request.xml in your module's etc folder , copy the entire node from vendor/Magento/CatalogSearch/etc/search_request.xml and change <queryReference ...
Arun S's user avatar
  • 191
5 votes
Accepted

Display the blank page on the SEARCH TERMS page

Appears to be a bug in 2.1. The code is trying to get the "name" of the search term when it should be asking for the "query_text." You can get it to work by updating the following two files: File ...
Mat Hellums's user avatar
4 votes

Facing issue with catalogsearch_query table when using Magento search

As the topic starter stated in his comment, the fix for this was to backup the search terms, then truncate the table and reimport the search terms again.
Arjen Miedema's user avatar
3 votes
Accepted

Magento 1: search term is not being added back

TL;DR Debugging the issue Here's the workflow: Under app/code/core/CatalogSearch/controllers/ResultController.php in the indexAction(), the search term is retrieved by the following code: $query = ...
Raphael at Digital Pianism's user avatar
3 votes

Can You Block Search Terms

FishPig has this NoBots module which I've used before and it does work https://fishpig.co.uk/magento/extensions/block-robots-stop-spam/ hope it helps
Mariusz Pietrukowski's user avatar
3 votes

How do I change Magento 2 search from OR logic to AND?

For anyone who is looking into a working solution for Magento >2.4.0. First extend Magento\Elasticsearch\SearchAdapter\Query\Builder\Match by adding this to your di.xml (<VENDOR>/<Module&...
Julian's user avatar
  • 31
3 votes

Magento 2: Search Result inappropriate

Magento by default uses the MySql based search. So, it is split text on word on by pattern. It will show all the products with DR in the name.
Tanmay's user avatar
  • 790
2 votes

magento 2 EE should not save search terms with zero search results

Try this. Create a custom module and create following files. File: etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Yash Shah's user avatar
  • 2,503
1 vote
Accepted

Header search bar search terms retrieve products collection

To display the product count for each autosuggestion keyword in Magento, you will need to perform the following steps: Override the Magento\CatalogSearch\Model\Autocomplete\DataProvider class in your ...
Navneet Sharma's user avatar
1 vote

Magento 2 Catalog Search not showing correct results

Try to set the search type to 'Fulltext' in 'System > Configuration > Catalog > Catalog Search' and then reindex the magento, check if this solves the problem.
Bhupendra Bisht's user avatar
1 vote
Accepted

Magento 2.3 OpenSource - How to implement Stopwords in ElasticSearch 6.x

I ran into the same issue that you had following the documentation provided. You were following the Change Stopword Directory instead you want to follow the instructions under To change the directory ...
fab5freddy's user avatar
1 vote

magento 2 Get Top Search Terms

Found a way using Magento\Search\Model\ResourceModel\Query\CollectionFactory ... $searchCollection = $this->_queryCollectionFactory->create() ->setPopularQueryFilter($this->...
Juliano Vargas's user avatar
1 vote

How do I change Magento 2 search from OR logic to AND?

you have to set AND operator in your elastic search JSON queries, Override the module-elasticsearch/SearchAdapter/Query/Builder/Match.php. file in your custom module and then The code you have to edit ...
Salman Hanif's user avatar
1 vote
Accepted

Magento Search Results: Echo SKU list of products in header.phtml or head.phtml

Place this code within header.phtml or head.phtml if($listBlock = $this->getLayout()->getBlock('search_result_list')) { $productCollection = $listBlock->getLoadedProductCollection(); $...
harri's user avatar
  • 5,465
1 vote

Programatically insert search term

Instead of modifying core code you should add your own observer in a custom module: Add this to app/code/POOL/My/Module/etc/confi.xml <events > <catalog_product_save_after > ...
sv3n's user avatar
  • 11.7k
1 vote

Searching for SKU without special characters

In a custom module, rewrite the qetQueryText() method in Mage_CatalogSearch_Helper_Data. Then, strip out the special characters of the query text before it is returned. public function getQueryText()...
Tim Cieplowski's user avatar
1 vote
Accepted

numbers coming up with my quick search results? CE 1.7.0.2

This is the number of results this search term matches (at least the last time it was used). If you don't wish the numbers to be visible the simplest solution will probably be to hide them with css. ...
Peter O'Callaghan's user avatar
1 vote

How can I resolve Foreign Key constraint 'SQLSTATE[23000]: Integrity constraint violation: 1452

Was facing the same issue and get rid of it by re-indexing all through ssh. Here is the command that I used php shell/indexer.php reindexall
Imran Zahoor's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible