ahammad wrote:
> 
> Is it possible to add a prefix to the data in a Solr field? For example,
> right now, I have a field called "id" that gets data from a DB through the
> DataImportHandler. The DB returns a 4-character string like "ag5f". Would
> it be possible to add a prefix to the data that is received?
> 
> In this specific case, the data relates to articles. So effectively, if
> the DB has "ag5f" as an ID, I want it to be stored as "Article_ag5f". Is
> there a way to define a prefix of "Article_" for a certain field?
> 

I have exactly this situation and I just handle it by adding the prefixes in
the SQL query.

select 'Article_' || id as id
from articles
etc.

I wrap all these up as views and store them in the DB, so Solr just has to
select * from each view.

Andrew.

-- 
View this message in context: 
http://www.nabble.com/Adding-a-prefix-to-fields-tp25062226p25062356.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to