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 nourredine khadri <no...@yahoo.com> on 2009/09/10 14:51:06 UTC

Re : Indexing fields dynamically

Thanks for the quick reply.

Ok for dynamicFields but  how can i rename fields during indexation/search to add suffix corresponding to the type ?  

What is the best way to do this?

Nourredine.




________________________________
De : Yonik Seeley <yo...@lucidimagination.com>
À : solr-user@lucene.apache.org
Envoyé le : Jeudi, 10 Septembre 2009, 14h24mn 26s
Objet : Re: Indexing fields dynamically

On Thu, Sep 10, 2009 at 5:58 AM, nourredine khadri
<no...@yahoo.com> wrote:
> I want to index my fields dynamically.
>
> DynamicFields don't suit my need because I don't know fields name in advance and fields type must be set > dynamically too (need strong typage).

This is what dynamic fields are meant for - you pick both the name and
type (from a pre-defined set of types of course) at runtime.  The
suffix of the field name matches one of the dynamic fields and
essentially picks the type.

-Yonik
http://www.lucidimagination.com



      

Re : Re : Re : Indexing fields dynamically

Posted by nourredine khadri <no...@yahoo.com>.
Ok, i'll try the transformer (javascript needs jdk1.6 i think)

Thanks again.




Noble Paul wrote : 
>
>If you use DIH for indexing writing a transformer is the simplest
>thing. You can even write it in javascript
>


      

Re: Re : Re : Indexing fields dynamically

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
If you use DIH for indexing writing a transformer is the simplest
thing. You can even write it in javascript

On Fri, Sep 11, 2009 at 1:13 PM, nourredine khadri
<no...@yahoo.com> wrote:
>
> The pb is that i don't handle fields name. It can be anything (i want to let the developpers free for this)
> Where and how can I change to fields name on the fly  (to add "_i" for example) before indexing?
>
> Do i have to use a transformer? an UpdateRequestProcessor? ...
>
> Which api suits for this? SolrInputDocument? the setField() method? removeField() + addField() ?, ...
>
> Thanks
>
>
>
>
> Lance Norskog wrote :
>>
>>In the schema.xml file, "*_i" is defined as a wildcard type for integer.
>>If a name-value pair is an integer, use: name_i as the field name.
>
>
>
> On 9/10/09, nourredine khadri <no...@yahoo.com> wrote:
>>
>> Thanks for the quick reply.
>>
>> Ok for dynamicFields but  how can i rename fields during indexation/search
>> to add suffix corresponding to the type ?
>>
>> What is the best way to do this?
>>
>> Nourredine.
>>
>>
>>
>>
>> ________________________________
>> De : Yonik Seeley <yo...@lucidimagination.com>
>> À : solr-user@lucene.apache.org
>> Envoyé le : Jeudi, 10 Septembre 2009, 14h24mn 26s
>> Objet : Re: Indexing fields dynamically
>>
>> On Thu, Sep 10, 2009 at 5:58 AM, nourredine khadri
>> <no...@yahoo.com> wrote:
>> > I want to index my fields dynamically.
>> >
>> > DynamicFields don't suit my need because I don't know fields name in
>> advance and fields type must be set > dynamically too (need strong typage).
>>
>> This is what dynamic fields are meant for - you pick both the name and
>> type (from a pre-defined set of types of course) at runtime.  The
>> suffix of the field name matches one of the dynamic fields and
>> essentially picks the type.
>>
>> -Yonik
>> http://www.lucidimagination.com
>>
>>
>>
>>
>
>
>
>
> --
> Lance Norskog
> goksron@gmail.com
>
>
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re : Re : Indexing fields dynamically

Posted by nourredine khadri <no...@yahoo.com>.
The pb is that i don't handle fields name. It can be anything (i want to let the developpers free for this)
Where and how can I change to fields name on the fly  (to add "_i" for example) before indexing?

Do i have to use a transformer? an UpdateRequestProcessor? ...

Which api suits for this? SolrInputDocument? the setField() method? removeField() + addField() ?, ...

Thanks




Lance Norskog wrote : 
>
>In the schema.xml file, "*_i" is defined as a wildcard type for integer.
>If a name-value pair is an integer, use: name_i as the field name.



On 9/10/09, nourredine khadri <no...@yahoo.com> wrote:
>
> Thanks for the quick reply.
>
> Ok for dynamicFields but  how can i rename fields during indexation/search
> to add suffix corresponding to the type ?
>
> What is the best way to do this?
>
> Nourredine.
>
>
>
>
> ________________________________
> De : Yonik Seeley <yo...@lucidimagination.com>
> À : solr-user@lucene.apache.org
> Envoyé le : Jeudi, 10 Septembre 2009, 14h24mn 26s
> Objet : Re: Indexing fields dynamically
>
> On Thu, Sep 10, 2009 at 5:58 AM, nourredine khadri
> <no...@yahoo.com> wrote:
> > I want to index my fields dynamically.
> >
> > DynamicFields don't suit my need because I don't know fields name in
> advance and fields type must be set > dynamically too (need strong typage).
>
> This is what dynamic fields are meant for - you pick both the name and
> type (from a pre-defined set of types of course) at runtime.  The
> suffix of the field name matches one of the dynamic fields and
> essentially picks the type.
>
> -Yonik
> http://www.lucidimagination.com
>
>
>
>




-- 
Lance Norskog
goksron@gmail.com



      

Re: Re : Indexing fields dynamically

Posted by Lance Norskog <go...@gmail.com>.
In the schema.xml file, "*_i" is defined as a wildcard type for integer.
If a name-value pair is an integer, use: name_i as the field name.



On 9/10/09, nourredine khadri <no...@yahoo.com> wrote:
>
> Thanks for the quick reply.
>
> Ok for dynamicFields but  how can i rename fields during indexation/search
> to add suffix corresponding to the type ?
>
> What is the best way to do this?
>
> Nourredine.
>
>
>
>
> ________________________________
> De : Yonik Seeley <yo...@lucidimagination.com>
> À : solr-user@lucene.apache.org
> Envoyé le : Jeudi, 10 Septembre 2009, 14h24mn 26s
> Objet : Re: Indexing fields dynamically
>
> On Thu, Sep 10, 2009 at 5:58 AM, nourredine khadri
> <no...@yahoo.com> wrote:
> > I want to index my fields dynamically.
> >
> > DynamicFields don't suit my need because I don't know fields name in
> advance and fields type must be set > dynamically too (need strong typage).
>
> This is what dynamic fields are meant for - you pick both the name and
> type (from a pre-defined set of types of course) at runtime.  The
> suffix of the field name matches one of the dynamic fields and
> essentially picks the type.
>
> -Yonik
> http://www.lucidimagination.com
>
>
>
>




-- 
Lance Norskog
goksron@gmail.com