Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple analyzers on 1 field

Got 2 fields (name & description), using a Danish analyzer. Now I need to support it with an English analyser too.

What is my solutions?

  1. Add more analysers on the fields?
  2. Set the language when looking up? (don't think this works, because the data wouldn't be analyzed)
  3. have 2 extra fields name_en & description_en?
like image 760
Kim Egede Jakobsen Avatar asked Oct 21 '22 08:10

Kim Egede Jakobsen


1 Answers

Use a multi-field where the name and description use your Danish analyzer. Then have a field like name.en and description.en use an English analyzer.

http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/

like image 103
Matt Weber Avatar answered Oct 24 '22 03:10

Matt Weber