laravel-scout-elasticsearch icon indicating copy to clipboard operation
laravel-scout-elasticsearch copied to clipboard

configure stopwords

Open mondherid opened this issue 1 year ago • 1 comments

hello, how can i config of stop words for arabic language and english language, i did it like that but it doesn't work :

'analysis' => [
    'analyzer' => [
        'custom_analyzer' => [
            'type' => 'custom',
            'tokenizer' => 'standard',
            'filter' => [
                'lowercase',
                'my_custom_stop_words_filter',
                'synonym_filter',
            ],
        ],
    ],
    'filter' => [
        "my_custom_stop_words_filter"=> [
            "type"=> "stop",
            "ignore_case"=> true,
            "stopwords" => [ "من", "ومن",  "منها", "منه", "في", "وفي", "فيها",    ]
        ],
        "synonym_filter"=> [
            "type"=> "synonym",
            "synonyms"=> [ "ا,أ,إ" ]
        ]
    ],
],

mondherid avatar Jul 07 '23 14:07 mondherid

Did you try this on Kibana console? Is it working well with custom stop words in Arabic? To understand it is related with library or the elastic itself.

hkulekci avatar Jul 09 '23 14:07 hkulekci