mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 02:48:26 +00:00
Add 9 more lanugages to the list of document lanugages
This commit is contained in:
@ -32,7 +32,8 @@ object Field {
|
||||
.map(contentField)
|
||||
|
||||
def contentField(lang: Language): Field =
|
||||
Field(s"content_${lang.iso2}")
|
||||
if (lang == Language.Czech) Field(s"content_cz")
|
||||
else Field(s"content_${lang.iso2}")
|
||||
|
||||
implicit val jsonEncoder: Encoder[Field] =
|
||||
Encoder.encodeString.contramap(_.name)
|
||||
|
@ -75,12 +75,33 @@ object SolrSetup {
|
||||
solrEngine,
|
||||
"Add content_es field",
|
||||
addContentField(Language.Spanish).map(_ => FtsMigration.Result.reIndexAll)
|
||||
),
|
||||
FtsMigration[F](
|
||||
9,
|
||||
solrEngine,
|
||||
"Add more content fields",
|
||||
addMoreContentFields.map(_ => FtsMigration.Result.reIndexAll)
|
||||
)
|
||||
)
|
||||
|
||||
def addFolderField: F[Unit] =
|
||||
addStringField(Field.folderId)
|
||||
|
||||
def addMoreContentFields: F[Unit] = {
|
||||
val remain = List[Language](
|
||||
Language.Norwegian,
|
||||
Language.Romanian,
|
||||
Language.Swedish,
|
||||
Language.Finnish,
|
||||
Language.Danish,
|
||||
Language.Czech,
|
||||
Language.Dutch,
|
||||
Language.Portuguese,
|
||||
Language.Russian
|
||||
)
|
||||
remain.traverse(addContentField).map(_ => ())
|
||||
}
|
||||
|
||||
def setupCoreSchema: F[Unit] = {
|
||||
val cmds0 =
|
||||
List(
|
||||
@ -162,7 +183,8 @@ object SolrSetup {
|
||||
AddField(field, "text_general", true, true, false)
|
||||
|
||||
def textLang(field: Field, lang: Language): AddField =
|
||||
AddField(field, s"text_${lang.iso2}", true, true, false)
|
||||
if (lang == Language.Czech) AddField(field, s"text_cz", true, true, false)
|
||||
else AddField(field, s"text_${lang.iso2}", true, true, false)
|
||||
}
|
||||
|
||||
case class DeleteField(name: Field)
|
||||
|
Reference in New Issue
Block a user