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 ...
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 ...
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 ...
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.
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
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.
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&...
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:...
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 ...
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 ...
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.
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 ...
1
vote
magento 2 Get Top Search Terms
Found a way using Magento\Search\Model\ResourceModel\Query\CollectionFactory
...
$searchCollection = $this->_queryCollectionFactory->create()
->setPopularQueryFilter($this->...
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();
$...
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 >
...
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()...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
search-terms × 63search × 31
catalogsearch × 24
magento2 × 17
magento-1.9 × 10
search-criteria × 7
magento-2.1 × 4
magento2.3 × 4
advanced-search × 4
product × 3
magento-1.7 × 3
magento-1.8 × 3
database × 3
magento-1 × 3
elasticsearch × 3
magento2.4 × 2
security × 2
ce-1.9.1.0 × 2
sku × 2
admin × 1
event-observer × 1
configurable-product × 1
error × 1
api × 1
adminhtml × 1