Skip to content

Commit

Permalink
add uax_url_email analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
izakp committed Jul 25, 2019
1 parent 040903a commit 4fc1a4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/estella/analysis.rb
Expand Up @@ -18,6 +18,9 @@ module Analysis
NGRAM_ANALYZER =
{ type: 'custom', tokenizer: 'standard_tokenizer', filter: %w[lowercase asciifolding front_ngram_filter] }

EMAIL_ANALYZER =
{ type: 'custom', tokenizer: 'uax_url_email', filter: %w[lowercase stop] }

DEFAULT_ANALYSIS = {
tokenizer: {
standard_tokenizer: { type: 'standard' }
Expand All @@ -30,6 +33,7 @@ module Analysis
snowball_analyzer: SNOWBALL_ANALYZER,
shingle_analyzer: SHINGLE_ANALYZER,
ngram_analyzer: NGRAM_ANALYZER,
email_analyzer: EMAIL_ANALYZER,
search_analyzer: DEFAULT_ANALYZER
}
}
Expand All @@ -38,7 +42,8 @@ module Analysis
default: { type: 'text', analyzer: 'default_analyzer' },
snowball: { type: 'text', analyzer: 'snowball_analyzer' },
shingle: { type: 'text', analyzer: 'shingle_analyzer' },
ngram: { type: 'text', analyzer: 'ngram_analyzer', search_analyzer: 'search_analyzer' }
ngram: { type: 'text', analyzer: 'ngram_analyzer', search_analyzer: 'search_analyzer' },
email: { type: 'text', analyzer: 'email_analyzer'}
}

DEFAULT_FIELD_FACTORS = {
Expand Down

0 comments on commit 4fc1a4f

Please sign in to comment.