Hot answers tagged

14 votes
Accepted

Magento 2: what is the search_request.xml file used for?

Magento 2 provides a declarative way to describe search request which should be executed. search_request.xml is a part of Query API. This declaration describes: What index should be queried What ...
Igor Minyaylo's user avatar
11 votes

Get Option Value by Id of Attribute in Magento

Simply put - use the getAttributeText method. $product->getAttributeText('brand')
PromInc's user avatar
  • 420
11 votes

Where is the ListProduct.php under Magento\CatalogSearch\Block\SearchResult?

Let me answer it by myself. I can't find the ListProduct.php under Magento\CatalogSearch\Block\SearchResult because it is a virtual type which will be redirected to Magento\Catalog\Block\Product\...
Ricky.C's user avatar
  • 2,162
11 votes
Accepted

Magento 1.9.3: every product is displayed in the search in full text mode

Edit: this is not the only 1.9.3.0 bug. See this answer for details and a module that fixes all the bugs: https://magento.stackexchange.com/a/140826/2380 This is a bug. Thanks to IWeb for ...
Raphael at Digital Pianism's user avatar
11 votes
Accepted

Magento 2: How to remove "Did you mean" section from search page?

https://docs.magento.com/user-guide/catalog/search-configuration.html#general-search-options You can disable(select no) following both the options, from System Configuration -> Catalog -> ...
Softec's user avatar
  • 2,055
11 votes
Accepted

Magento 2 Pagination not working on search results - Porto Theme

After messing around with this for a bit I think I found the issue. I'm by no means an expert or know much about Magento 2. I'm also on Magento 2.4.0 and on Porto 3.2.5(One update back). The Issue is ...
Darin Minard's user avatar
8 votes
Accepted

URL Redirect from Catalog Search to Category Page

Magento has that ability built in, though it must be managed. If you go to Catalog -> Search Terms, you can enter the search query you want to redirect, and the destination URL for the redirect.
AreDubya's user avatar
  • 1,344
8 votes

How to get Search Result Count in head.phtml

Please try bellow code if($listBlock = $this->getLayout()->getBlock('search_result_list')) { $productCollection = $listBlock->getLoadedProductCollection(); echo $productCollection-&...
Abdul's user avatar
  • 9,662
7 votes
Accepted

What factors are used to determine display order when the "Sort By Relevance" option is used while searching in Magento Connect?

I would suppose that search is implemented using MySQL FULLTEXT index. Here is a quote from MySQL official documentation regarding to how that index works: Rows returned are automatically sorted ...
alex_b's user avatar
  • 706
7 votes
Accepted

Download the magento connect extensions list

You can use this link to fetch all of them: http://connect20.magentocommerce.com/community/packages.xml However, it still won't be too reliable as it contains also extensions which are no longer ...
Wojtek Naruniec's user avatar
7 votes
Accepted

Magento2; Advanced Searching (SmartSearch)

To perform full text search Magento\Framework\Api\Search\SearchInterface should be used. Please note that Service Contracts concept was introduced in Magento 2, even though Service API is available ...
Alex Paliarush's user avatar
7 votes

magento 2 : catalog search with less than 3 characters

I do not know your search engine, I suppose that you use Mysql. It works out of the box with ElasticSearch. Resolution : First set the minimun search characters to 1 in Magento configuration : Admin ...
Franck Garnier's user avatar
7 votes
Accepted

Customer Repository Interface, Limit Results

Figured it out. http://devdocs.magento.com/guides/v2.2/extension-dev-guide/searching-with-repositories.html $searchCriteria = $this->searchCriteria ->setFilterGroups([$...
Ethan Yehuda's user avatar
6 votes
Accepted

Why does the default VCL produced by Magento force search requests to bypass Varnish?

Yes, because search results change frequently and Magento doesn't know how to invalidate those results. And because the world isn't a perfect place to live :( Anyway, you can do just: # Bypass ...
Danila Vershinin's user avatar
6 votes
Accepted

Magento 2 - Enabled show/hide functionality on header search

You need to specify the media parameter to the mediaCheck function: mediaCheck({ media: 'all', entry: function () { this.isExpandable = true; }.bind(this), exit: function () { ...
Aaron Allen's user avatar
  • 8,939
6 votes
Accepted

Magento 2 : How To Add Search By Category In Advanced Search?

To add this, you will need to override the following files: vendor/magento/core/module-catalog-search/Block/Advanced/Form.php vendor/magento/core/module-catalog-search/Model/Advanced.php vendor/...
Nitesh's user avatar
  • 2,088
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.6k
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
6 votes

Magento 2 CE and ElasticSearch integration

Yes, you can. Here is step-by-step manual: https://github.com/Smile-SA/elasticsuite/wiki
Kyrylo Romantsov's user avatar
6 votes
Accepted

How to make magento 2.2.1 website search results more accurate

I have done this before which is improved search results. Try this - Step 1 : Go to admin -> Stores -> Click on "Product" (Under Attributes). Step 2 : Filter searchable attributes from Grid. Step 3 ...
Indranil Maity's user avatar
6 votes

I am unable to edit search engine robots from admin

If you navigate to Store > Configuration > Catalog > XML Sitemap and scroll down to Search Engine Submission Settings, you’ll find a setting that enables you to add the sitemap: directive to your ...
Aditya Shah's user avatar
  • 7,517
5 votes

Catalog Search looking at descriptions = returning irrelevant search results

I too faced the same problem before. This is because by default "description" attribute is set to Searchable. Solution: Login to Magento Admin Panel. Goto Catalog > Attributes > Manage Attributes ...
Saurabh's user avatar
  • 218
5 votes

Manually specifying top search results for a specific search query

You could create a new text area attribute "search_boost", make it not visible in the frontend but searchable and use it to add search terms where this product should show up. With the default ...
Fabian Schmengler's user avatar
5 votes
Accepted

Manually specifying top search results for a specific search query

A wild idea. Not sure if it will work, but you can give it a try. It's simple and not very time consuming. The search works like this. The attributes you marked as searchable are indexed in the table. ...
Marius's user avatar
  • 198k
5 votes

Can you block Google from crawling filters?

Magento has the setRobots method to insert the values in the robots tag within the head block. So you can create a extension to change the head block via observer. In your config.xml add a event to ...
Denis Spalenza's user avatar
5 votes

Magento2 Enterprise Search what’s changed?

Checkout out this link for Enterprise features. For search we've made some significant improvements in 2.0 over M1x. Streamlined MySQL Search Engine Config to just FullText Search Replaced / Tuned ...
Chuck's user avatar
  • 812
5 votes

Magento 2: what is the search_request.xml file used for?

Looks like it's used to define attributes certain filters should be applied to and then searchable attributes are applied against this XML to configure the searchRequest - see: Magento\CatalogSearch\...
Daniel Kenney's user avatar
5 votes

How does Magento 2 Search work with '-'?

Magento by default using MySql based search. So, it is split text on word on by pattern like [^a-z0-9_]. it's why aaa-bbb interpreted as "aaa bbb" see more details here: http://dev.mysql.com/doc/...
KAndy's user avatar
  • 20.7k
5 votes
Accepted

Magento 2 CE and ElasticSearch integration

Magento 2 Open Source (CE) does not provide integration with elasticsearch by default. We have following options: Create your own Custom extension (Can be explained separately) Use following Free ...
mshakeel's user avatar
  • 518
5 votes
Accepted

Make search bar visible in mobile view

Add the below lines to your css: .block-search .minisearch input#search{position:static;} .block-search .minisearch .label{display:none;} It works for me on luma theme. Use the above code under ...
Sukumar Gorai's user avatar

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