-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analyser parameters in migration #53
Comments
Hey @drsdre - The docs are not clear on this, but you can set the filter settings as Schema::modify('my_index', function (IndexBlueprint $index) {
$index->settings('max_ngram_diff', 20);
});
Schema::setAnalyser('my_index', function (AnalyzerBlueprint $settings) {
$settings->filter('email_token_filter')
->type('pattern_capture')
->preserve_original(true)
->patterns(['([^@]+)']);
$settings->filter('edge_ngram_token_filter')
->type('edge_ngram')
->min_gram('1')
->max_gram('20');
$settings->analyzer('email_analyzer')
->filter([
'email_token_filter',
'lowercase',
'edge_ngram_token_filter',
'unique',
])
->type('custom')
->tokenizer('uax_url_email');
}); Try and let me know |
Thanks for the quick reply. Adding the settings works now. Applying the analyzer to the fields however seems to be going into a loop. I cannot set the analyzer before the IndexBlueprint is created, but setting the analyser on the field is failing too. Maybe I'm using the wrong IndexBlueprint function. This is what I now have:
It fails with the error: I'm guessing I'm using the wrong mapping? Your help is much appreciated. |
Try:
|
Thanks. That did work well.
Unfortunately, with the email analyser in place I'm no longer getting search results back for these fields. I was under the impression that the analyser would be applied both during indexing and processing the search query. Or do I need to amend the queries to make use of the new sub indexes? I realise this question goes beyond your package and is actually about the workings of ElasticSearch. However if you can point me in the right direction... Thanks, |
First of thanks for all the hard work on this package!
I'm trying to model an email address analyser profile in the migration analogue to this one:
https://github.com/andrewdieken/elasticsearch-effective-email-search/blob/main/index_settings.json
Is it possible to add filter parameters like 'preserve_original' and 'min_gram' and 'max_gram' within provided fluent function of AnalyzerBlueprint?
Thanks,
Andre
The text was updated successfully, but these errors were encountered: