Types of Solr Dynamic Fields

I have a field in Solr

<dynamicField name="Phrase_*" type="string" indexed="true" stored="true" multiValued="true" required="false"/>

which is used to store phrases in different languages, so names tend to be "Phrase_en", "Phrase_sp", etc. I have analyzers and filters for working with fields with different languages ​​for types named in the same way ("string_en", "string_sp", etc.) that make the correct conclusion / synonym for the corresponding language, and I would like to find a way equipping it so that for each language the correct set of analyzer / filter is used, based on the field name.

At the moment, the only thing I can think of is to create a type that multiplexes these sets of analyzers and makes a judgment about which one to send to, but I don’t know how to do it.

Any ideas on how to do this, or the best way to achieve this?

+4
source share
1 answer

This issue is covered in detail in the book Solr In Action (recommended for those who want to dive deep into the configuration of Solr), and others to achieve the same result. There are 3 main approaches:

  • A separate field for each language is loading into separate fields (not dynamic), which have corresponding tokenizers and filters for the language.
  • Separate index / core for each language -
  • All in one field, custom control code -

Your suggestion is option 1 and 3 β€” the best place I can give you is to read the book you read (it is in chapter 14) and study the code that he put on Github to implement it:

https://github.com/treygrainger/solr-in-action/tree/master/src/main/java/sia/ch14 https://github.com/treygrainger/solr-in-action/tree/master/example-docs/ch14/cores

+4

Source: https://habr.com/ru/post/1541181/


All Articles