You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by tosenthu <to...@yahoo.com> on 2012/03/15 08:13:08 UTC
Field Value Substitution
Hi
I have a scenario, where I store a field which is an Id,
ID field
------
1
3
4
Descrption mapping
-------------------
1 = "Options 1"
2 = "Options A"
3 = "Options 3"
4 = "Options 4a"
Is there a way in solr when ever i query this field should return me the
description instead of the id. And help me with the procedure to setup solr
to do this..
Regards
Senthil Kumar M R
--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Value-Substitution-tp3828028p3828028.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Field Value Substitution
Posted by Erick Erickson <er...@gmail.com>.
I guess I don't quite understand. If the description field
is single valued, simply specifying that field on the
fl parameter should return it.
It would help if you showed some sample documents,
because I can't tell whether you only have one descriptor
per document or several....
By the way, you'll save yourself some trouble in the future if
you let your "id" field be your <uniqueKey> and use some
different field for non uniqueKey data....
Best
Erick
On Thu, Mar 15, 2012 at 2:13 AM, tosenthu <to...@yahoo.com> wrote:
> Hi
>
> I have a scenario, where I store a field which is an Id,
>
> ID field
> ------
> 1
> 3
> 4
>
> Descrption mapping
> -------------------
> 1 = "Options 1"
> 2 = "Options A"
> 3 = "Options 3"
> 4 = "Options 4a"
>
> Is there a way in solr when ever i query this field should return me the
> description instead of the id. And help me with the procedure to setup solr
> to do this..
>
> Regards
> Senthil Kumar M R
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Field-Value-Substitution-tp3828028p3828028.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Field Value Substitution
Posted by Jan Høydahl <ja...@cominvent.com>.
You could use the MappingUpdateProcessor for this, doing the mapping through a simple synonyms-like config file at index time, indexing the description in a String field. https://issues.apache.org/jira/browse/SOLR-2151
Or you could make a SearchComponent plugin doing the same thing "live" at query time?
--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com
On 15. mars 2012, at 08:13, tosenthu wrote:
> Hi
>
> I have a scenario, where I store a field which is an Id,
>
> ID field
> ------
> 1
> 3
> 4
>
> Descrption mapping
> -------------------
> 1 = "Options 1"
> 2 = "Options A"
> 3 = "Options 3"
> 4 = "Options 4a"
>
> Is there a way in solr when ever i query this field should return me the
> description instead of the id. And help me with the procedure to setup solr
> to do this..
>
> Regards
> Senthil Kumar M R
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Field-Value-Substitution-tp3828028p3828028.html
> Sent from the Solr - User mailing list archive at Nabble.com.