Elasticsearch won't index single characters

Hi everybody,

I'm facing a strange issue with Elasticsearch x Sugar.

Some of the Accounts created with the following names are not returned when typing their names in the quick search. For example : 

  • C For Clean
  • C & D - associés
  • Architectes Atelier D & R
  • AC Kayl

When there is a single character, the search result won't return the string filled in the input.

Do you have an idea ?

Sugar is running on 11.0.3 PRO.

Thanks in advance for your ideas.

Best regards,

Enes

Parents
  • Well, finally my problem is deeper than I think, and linked to the "stopwords" analyzer of Elasticsearch.

    I tried to add a custom analyzer like that : 

    public function buildAnalysis(AnalysisBuilder $builder)
        {
            // define ASCII folding filter
            $builder->addFilter(
                'gs_stopwords',
                'stop',
                array(
                    'stopwords' => '_english_'
                )
            );
    
            // analyzers for which to inject ASCII folding filter
            $analyzers = array(
                'gs_analyzer_string',
                'gs_analyzer_string_ngram',
                'gs_analyzer_text_ngram',
                'gs_analyzer_string_exact',
            );
    
            // use injector to prepend the ASCII folding filter
            $injector = new AnalysisBuilderInjector($builder);
            $injector->prependFilter('gs_stopwords', $analyzers);
        }

    And also registered the analyzer, but after QRR and reindexing I still don't get the results I want, for example if I type C For Clean it should return me the record with this Analyzer, or am I wrong? 

    Is there anybody of you that tried such a thing ?

    Thanks in advance for your feedbacks.

    Best regards,

    Enes

Reply
  • Well, finally my problem is deeper than I think, and linked to the "stopwords" analyzer of Elasticsearch.

    I tried to add a custom analyzer like that : 

    public function buildAnalysis(AnalysisBuilder $builder)
        {
            // define ASCII folding filter
            $builder->addFilter(
                'gs_stopwords',
                'stop',
                array(
                    'stopwords' => '_english_'
                )
            );
    
            // analyzers for which to inject ASCII folding filter
            $analyzers = array(
                'gs_analyzer_string',
                'gs_analyzer_string_ngram',
                'gs_analyzer_text_ngram',
                'gs_analyzer_string_exact',
            );
    
            // use injector to prepend the ASCII folding filter
            $injector = new AnalysisBuilderInjector($builder);
            $injector->prependFilter('gs_stopwords', $analyzers);
        }

    And also registered the analyzer, but after QRR and reindexing I still don't get the results I want, for example if I type C For Clean it should return me the record with this Analyzer, or am I wrong? 

    Is there anybody of you that tried such a thing ?

    Thanks in advance for your feedbacks.

    Best regards,

    Enes

Children