Blast Search Lucene Search Module for Magento 2 Requirements : Magento 2.0.x or 2.1.x, pcre and pcntl php modules enabled
Version 1.1.3 for Magento 2 1 Installation...3 1.1 Manual Install... 3 1.2 Composer install...4 2. Configuration...5 2.1 Licensing... 5 2.2 General... 6 2.2.1 Active search engine...6 2.2.2 Limit results...6 2.2.3 Show out of stock last...6 2.2.4 Search mode...6 2.2.5 Lucene fulltext operator...7 2.2.6 Chars to spaces...7 2.2.7 Chars to trim...7 2.2.8 UTF-8 compatibility...7 2.2.9 Stop words...7 2.3 No results behaviour...7 2.3.1 Second pass enable...7 2.3.2 Second pass quantity...7 2.3.3 Third pass enable...8 2.3.4 Third pass quantity...8 2.3.5 No results search mode (for second pass)...8 2.3.6 No results matching mode (for third pass)...8 2.3.7 No results full text operator (for second pass)...8 2.4 Synonyms...8 2.4.1 Enabled synonyms...8 2.4.2 Synonyms definitions...8 2.5 Logs... 9 2.5.1 Enable logs...9 3. FAQ... 10 3.1 Where is the index stored?...10 3.2 How can I control which attribute is more important than another?...10 3.3 Module is not working at all...11 3.4 How can choose which attributes are searchable?...11 3.5 What should I do if I have multi-server setup?...11 3.6 I need help... 11 Thank You for your business, we are extremely happy that you decided to fix your Magento 2 search. To help you with the process we created this documentation which is divided into sections.
1 Installation At this point you have 2 choices you can install it manually via command line or if you have your own git repository you can add it there and include it. First method is quick and easy, but if you re thinking about reusing it on many projects please go composer route as it will be much easier to maintain consistency between all projects. 1.1 Manual Install Step 1: Backup your code directory and magento database you can do it via command line using n98magerun2 or you can do it directly from magento admin this will ensure that if things go wrong you can always revert back to previous version. Step 2: Download the extension from My Account section Step 3: Upload it to your Magento installation root directory ideally please check it on your dev/stage server first to make sure it works as expected. Step 4: Login to your server via SSH and in the terminal enter the following at the command line prompt: cd /path/to/your/magento2/root/folder mkdir p app/code/php4u/ unzip module bsl m2.zip module bsl m2/* d app/code/php4u/ mv app/code/php4u/module bsl m2 app/code/php4u/blastsearchlucene php bin/magento module:enable Php4u_BlastSearchLucene php bin/magento setup:upgrade If your Magento 2 is in production mode you need also php bin/magento bin/magento setup:static content:deploy php bin/magento bin/magento setup:di:compile Step 5: After login into Admin and opening Stores >> Configuration >> Advanced >> Advanced, the module will be shown in the admin panel Also you should notice new configuration section Php4u Extensions 1.2 Composer install
Create new git repository and call it for example php4u-blastsearchlucene, note the git ssh url to that newly created repository as you will need it later. Then create any folder and extract downloaded package there. Once you are inside newly created directory run following in the command line: git init git remote add origin git@github.com:yourcompany/php4ubslm2.git git checkout b master git add * git commit m "Initial commit of version 1.1.3" git tag 1.1.3 git push origin master tags At this point code should be pushed to your repository and ready to be included in your project. You can confirm it by going in your browser to the repository and checking source there. Step 1: Add repository url intto your project composer config repositories.php4ubsl git git@github.com:yourcompany/php4u blastsearchlucene.git Step 2: Add it as dependency to your project composer require php4u/module bsl m2 Step 3: refresh caches and other areas php bin/magento setup:upgrade If your Magento 2 is in production mode you need also php bin/magento bin/magento setup:static content:deploy php bin/magento bin/magento setup:di:compile 2. Configuration
Configuration can be found in Stores -> Configuration -> Php4u Extensions There are 5 main areas which will be described later. 2.1 Licensing In this section you need to enter serial key (license key provided to you at the purchase). If you have any issues locating it or you need regenerating it please contact support. It is quite important to understand that license is issued per domain, so if you have multiple frontend urls and also your admin url is different they all require separate licenses. Example: Admin myadmin.secretstoremanagement.com Store 1 secretshoesstore.com Store 2 - secretjeansstore.com Store 3 en.secretjeansstore.com As you can see above Store 2 and 3 are on same subdomain so only once license will cover it, but Admin, Store 1 and Store 2 are all different domains in total there are 3 licenses required. They need to be added at different store view. More about which domains you can use can be found here - https://php4u.zendesk.com/entries/20710397-which-domains-can-i-usewith-my-license-
2.2 General 2.2.1 Active search engine Indicates which search engine is in use in Magento 2. Our module follows Magento 2 best practice and implements separate search engine which can be selected in Stores -> Configuration -> Catalog -> Catalog -> Catalog Search 2.2.2 Limit results If you specify 0 all results are returned which with large catalogues can become slow. For that reason, limit search results to a reasonable number. 2.2.3 Show out of stock last If you enable that option and you allow out of stock products to be visible they will be pushed as last into search results. 2.2.4 Search mode Lucene can work in 2 modes, full text or phrase. Full text will look for any keywords in any order. As example new shiny table search will be treated as searching for 3 keywords new, shiny and table in any order. These keywords can be present in any searchable field. To control if all or any of the keywords should be present see 2.2.5.
Phrase mode is much strict and can product least number of results as it require all keywords to be in exact order. In 90% of cases full text mode is sufficient. 2.2.5 Lucene fulltext operator It is used only when in 2.2.4 full text mode is enabled. By selecting AND all keywords must be present, OR will mean that any of the keywords must be present. 2.2.6 Chars to spaces When you need certain characters to be replaced as spaces please provide them in this field. It might be useful specially for any characters which are separating keywords such as hyphens. Also see next 2.2.7 2.2.7 Chars to trim This option allows you to completely remove certain characters to be excluded from search and index. See 2.2.6 as well. 2.2.8 UTF-8 compatibility Indexer is treating characters as UTF-8, but if for any reason you need non-utf characters to be stored and searched on use this method. 2.2.9 Stop words Every language has words which can be easily excluded from the index as those are too common to be indexed we have prepared a list which is loaded as a part of the module, but if you need to add more use this setting. Stopwords file is located in etc/stopwords folder of this module. 2.3 No results behaviour Module offers multiple pass in a situation where first pass provided no results. 2.3.1 Second pass enable This will enable second pass to be executed. 2.3.2 Second pass quantity
If the first pass provided less results than quantity specified in this setting second pass results will be appended to first pass results. 2.3.3 Third pass enable This will enable third pass to be executed. This will only be done if first, or first and second provided not returned results (or not enough results see 2.3.4) 2.3.4 Third pass quantity If the first pass and second pass provided less results than quantity specified in this setting third pass results will be appended to first and second pass results. 2.3.5 No results search mode (for second pass) See 2.2.4 as this is exactly same behaviour 2.3.6 No results matching mode (for third pass) When third pass is executed it can be treated as wildcard or fuzzy search. Wildcard works only for keywords starting with given word so gre* will match green, gregory and gremlins, but it will not match ogre. Second mode fuzzy is a proximity search so it will try to match any keywords which are similar to given one. To check similarity module is using Levenshtein Distance, or Edit Distance algorithm. Fuzzy search can help with any misspellings. 2.3.7 No results full text operator (for second pass) It is used only when in 2.3.1 second pass is enabled. By selecting AND all keywords must be present, OR will mean that any of the keywords must be present. 2.4 Synonyms Synonyms can be very useful when your customers are using keyword replacements which are not very similar to each other and 2.3.7 fuzzy method is not sufficient. 2.4.1 Enabled synonyms This option will enable or disable synonyms functionality
2.4.2 Synonyms definitions In this section you can define which keywords are similar to which. 2.5 Logs Module can log quite a lot of information, which can be useful for any debugging purposed, but for busy websites it can also slow down indexing or searching process, so we do not recommend it to be enabled on production all the time. Logs are stored in [MAGENTO ROOT]/var/log/ folder 2.5.1 Enable logs This option with enable or disable logging
3. FAQ You can find answers for most common questions here. If you want to ask us any question please send us email on support@php4u.zendesk.com 3.1 Where is the index stored? Index is stored on disk in Lucene format in [MAGENTO ROOT]/var/indexer folders each storeview has separate subfolder there. This folder must have correct permissions so php can write/read there. 3.2 How can I control which attribute is more important than another? Login to admin and go to Stores > Attributes -> Product and edit attribute as per below then change weight settings bigger weight less important attribute is
3.3 Module is not working at all. Might be many reasons for that, most common are: Module is not enabled do bin/magento module:status and search for our module see section 1 Module license is not correct See section 2.1 There are conflicts of classes for example you have other modules which are overriding same classes / functionality Magento 2 is using original or other search engine see 2.2.1 3.4 How can choose which attributes are searchable? See section 3.2 3.5 What should I do if I have multi-server setup? You need to make sure that folder specified in 3.1 is shared from admin node to all frontend node this can be achieved by using simple nfs share, glusterfs share or you can do rsync every minute. What is important index when synced must be exactly as on admin so for rsync method please use delete option as well. 3.6 I need help Please contact us via https://php4u.zendesk.com
Again thank You for your trust and we are happy to be part of your success.