Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr - Multiple types for the same field

Tags:

solr

Is it possible to have a field in schema.xml that is of type text_fr or text_ar, because this field can be in french or in arabic?

Or should I regroup the definitions of text_fr or text_ar in the same custom type?

like image 308
Hakim Avatar asked Nov 18 '25 00:11

Hakim


2 Answers

You can use Copyfields to copy the source to multiple fields with different anaylysis.

Also,

<copyField source="text" dest="text_fr" />
<copyField source="text" dest="text_ar" />
like image 66
Jayendra Avatar answered Nov 19 '25 15:11

Jayendra


You should look into the Language Detection support that Solr provides.

This feature adds the ability to detect the language of a document before indexing and then make appropriate decisions about analysis, etc.

A little bit better description of this support and a comparison of the two supported detection types can be found in Solr Reference Guide - Detecting Languages During Indexing

like image 32
Paige Cook Avatar answered Nov 19 '25 17:11

Paige Cook