You can certainly do redirection of input values in an update processing,
even in a JavaScript script.
But there are also built-in "language identifier" update processors that can
simultaneously identify what language is used in the input value for a field
AND do the redirection to a language-specific field AND store the language
code.
See:
LangDetectLanguageIdentifierUpdateProcessorFactory
TikaLanguageIdentifierUpdateProcessorFactory
http://lucene.apache.org/solr/4_3_0/solr-langid/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.html
http://lucene.apache.org/solr/4_3_0/solr-langid/org/apache/solr/update/processor/TikaLanguageIdentifierUpdateProcessorFactory.html
http://wiki.apache.org/solr/LanguageDetection
The non-Tika version may be better, depending on the nature of your input.
Neither processor is in the new Apache Solr Reference Guide nor current
release from Lucid, but see the detailed examples in my book.
-- Jack Krupansky
-----Original Message-----
From: Furkan KAMACI
Sent: Wednesday, June 26, 2013 10:51 AM
To: solr-user@lucene.apache.org
Subject: Dynamic Type For Solr Schema
I use Solr 4.3.1 as SolrCloud. I know that I can define analyzer at
schema.xml. Let's assume that I have specialized my analyzer for Turkish.
However I want to have another analzyer too, i.e. for English. I have that
fields at my schema:
...
<field name="content" type="text_tr" stored="true" indexed="true"/>
<field name="title" type="text_tr" stored="true" indexed="true"/>
...
I have a field type as text_tr that is combined for Turkish. I have another
field type as text_en that is combined for Englished. I have another field
at my schema as lang. lang holds the language of document as "en" or "tr".
If I get a document that has a "lang" field holds "*tr*" I want that:
...
<field name="content" type="*text_tr*" stored="true" indexed="true"/>
<field name="title" type="*text_tr*" stored="true" indexed="true"/>
...
If I get a document that has a "lang" field holds "*en*" I want that:
...
<field name="content" type="*text_en*" stored="true" indexed="true"/>
<field name="title" type="*text_en*" stored="true" indexed="true"/>
...
I want dynamic types just for that fields other will be same. How can I do
that properly at Solr? (UpdateRequestProcessor, ...?)