matchish / laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout
MIT License
702 stars 113 forks source link

configure stopwords #254

Open mondherid opened 1 year ago

mondherid commented 1 year ago

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"=> [ "ا,أ,إ" ]
        ]
    ],
],
hkulekci commented 1 year ago

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.