Elasticsuite: Partial search doesn鈥檛 work.

Created on 22 Jun 2018  路  7Comments  路  Source: Smile-SA/elasticsuite

Partial search doesn鈥檛 work. Debugged with ElasticSearch Head Extension the same query returns results for the whole word and no results for part of the same word. Checked ElasticSearch index and product is there. We tried to change 'fuzziness' to 2 and' prefix_length' to 0 then we get too many products that are not related to the searched term.

Preconditions

Magento Version : 2.2.4
ElasticSuite Version : 2.5.0
Environment : Developer mode
Elasticsearch Version: 5.2.2


Third party modules :
Shopial_Facebook
Sofort_Payment
Ves_Megamenu
Vertex_Tax
Ves_PageBuilder
Ves_BaseWidget
Ves_All
Ho_Templatehints
AvS_ScopeHint
Bold_OrderComment
Klarna_Core
Amazon_Core
FireGento_MageSetup
Klarna_Ordermanagement
Amazon_Login
Klarna_Kp
Dotdigitalgroup_Email

Steps to reproduce

  1. Search for 'prof' and press enter
  2. On the search result page there is no result, although there are many products that contain the searched term in the name

Expected result

  1. Search for 'prof' and press enter
  2. The products are listed on the search page

Actual result

  1. Search for 'prof' and press enter
  2. No products are found
    search_result
  3. There are products on the category page that contain the searched term
    category_page
help wanted feature

Most helpful comment

This is, in my opinion, one of the most important missing features. Customers are just expecting this to work and don't understand that they don't get any results while searching for something while filling out a partial word.

All 7 comments

Partial search is not a feature we plan for now.
Maybe we could add it when we will refactor the spellchecker.

The option you have changed are only useful if you want to change the typo tolerance.

I would be glad to review some code / PR, if you think it is an important feature and you are able to deliver the feature.

This is, in my opinion, one of the most important missing features. Customers are just expecting this to work and don't understand that they don't get any results while searching for something while filling out a partial word.

Hi,

are there any new developments regarding this issue?

Thanks!

I gave up on it and switched to a paid version of Amasty.

Mee to. We also switched to a paid plugin.

There's no need for Smile to do that. you have possibility to extend xml-files in your project and make some minor code improvements.

just

  • add new filter to etc/elasticsuite_analysis.xml i.e.
<filters>
        <filter name="reference_ngram" type="edge_ngram" language="default">
            <min_gram>3</min_gram>
            <max_gram>20</max_gram>
            <token_chars></token_chars>
        </filter>
<filters>
  • add new analyser to etc/elasticsuite_analysis.xml which contains this new filter, i.e.
    <analyzers>
        <analyzer name="ngram_test" tokenizer="standard" language="default">
            <filters>
                <filter ref="ascii_folding" />
                <filter ref="lowercase" />
                <filter ref="word_delimiter" />
                <filter ref="elision" />
                <filter ref="reference_ngram" />
                <filter ref="trim" />
            </filters>
            <char_filters>
                <char_filter ref="html_strip" />
            </char_filters>
        </analyzer>
    </analyzers>
  • assign product.name to use this analyser etc/elasticsuite_indices.xml

    <index identifier="catalog_product" defaultSearchType="product">
        <type name="product" idFieldName="entity_id">
            <mapping>

                <field name="name" type="text">
                    <isSearchable>1</isSearchable>
                    <isUsedInSpellcheck>1</isUsedInSpellcheck>
                    <isFilterable>0</isFilterable>
                    <defaultSearchAnalyzer>ngram_test</defaultSearchAnalyzer>
                </field>
            </mapping>
        </type>
    </index>
  • i.e. patch src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php::getCutoffFrequencyQuery to include name in $queryParams

  • clean cache

  • full reindex catalogsearch

_disclaimer_. this is just example - just plain copy-paste might not help you. you need to be knowing what you are doing and you need to be DEV to understand this.

God bless you @elvinristi :pray:

Thanks for supporting this extension and taking some time about how extending it :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tschirmer picture tschirmer  路  4Comments

markdimi picture markdimi  路  4Comments

susonwaiba picture susonwaiba  路  3Comments

emirajbbd picture emirajbbd  路  3Comments

shamoon picture shamoon  路  3Comments