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
12 votes

Get Option Value by Id of Attribute in Magento

Simply put - use the getAttributeText method. $product->getAttributeText('brand')
PromInc's user avatar
  • 460
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,182
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,065
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
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
  • 9,009
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,108
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,597
6 votes

Magento 2.3.3 main.ERROR: {"error":{"root_cause":[{"type":"query_shard_exception","reason":" No mapping found for ['attribute'] in order to sort on

Custom Sort with ElasticSearch in Magento issue can be fixed by following these simple steps: Navigate to Stores->Attributes->Product in Admin. Add New Attribute. In Properties->Attribute ...
Hari Vijay Sudharsun'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
  • 802
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

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.8k
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
  • 528
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
5 votes
Accepted

magento 2 setFilterGroups is not working of custom module SearchCriteriaBuilder

Try the following code: private function getActivationCodeForOrderItem($orderId, $orderItem) { $orderFilter = $this->filterBuilder ->setField('order_id')->setValue($orderId)->...
Sohel Rana's user avatar
  • 35.7k
4 votes

Magento fast search API

I can suggest a solution we use : Algolia https://www.algolia.com/ There is a module for this https://github.com/algolia/algoliasearch-magento You can also see it in action in one of our customer : ...
Matthéo Geoffray's user avatar
4 votes
Accepted

Autosearch is not working

I have checked it on my local machine and its working with both the code. Please use below code. <script type="text/javascript"> //<![CDATA[ var searchForm = new Varien.searchForm('...
Jaimin Sutariya's user avatar
4 votes
Accepted

Magento 2 How to show Layered Navigation on home page?

To show layered navigation on home page do following-> Edit CMS homepage, inside it in design tab -> layout -> selected "2 columns with left bar". Then added following code in design-> Layout Update ...
Nitesh's user avatar
  • 2,108
4 votes

Magento 1.9 search not working properly

You gave to select Catalog,Search option in Visibility field. Thats reason new added products are not displaying in search result.
Jarnail S's user avatar
  • 4,687
4 votes
Accepted

Magento 2 short search keywords

Most probably this is a limitation on the database. The full text search index has its own minimum word length. I may be wrong, but I think the default is 4. Here are more details on how you can ...
Marius's user avatar
  • 198k
4 votes
Accepted

programatically search products in magento 2

If you want to search Product programatically, try below code. I used SKU to get Products. Call this in your template file. #File: app/code/Pulsestorm/RepositoryTutorial/Command/Examples.php ...
Rajkumar .E's user avatar
  • 3,550

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