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 Licinio Fernández Maurelo <li...@gmail.com> on 2009/08/18 10:39:47 UTC

Aliases for fields

Hello everybody,

can i set an alias for a field? Something like :

<field name="sourceDate" type="uniqueIdType" indexed="true"
stored="true" multiValued="false" termVectors="false"
alias="source.date"/>

is there any jira issue related?

Thx

-- 
Lici

Re: Aliases for fields

Posted by Licinio Fernández Maurelo <li...@gmail.com>.
Our purpose is to reuse the data stored in our indexes  serving  it to
multiple format clients (xml, php, json) directly (no mapper tier
wanted).

As clients model entities names doesn't match index field names, we
want to use alias in some way to adapt the response for the client.

Taking a look at solr wiki found this:

"This (CopyField) is provided as a convenient way to ensure that data
is put into several fields, without needing to include the data in the
update command multiple times"

i want to perform this behaviour in read-only mode (don't want to
duplicate data)

Thx


2009/8/18 Avlesh Singh <av...@gmail.com>:
>>
>> solr bean tags didn't fully acomplish this issue in our project due to
>> model complexity
>>
> Did you try annotating your pojo in this manner?
> @Field("index_field_name)
> pojoPropertyName;
>
> It will be nice to set an alias for some fields to match the pojo.property
>> name. Don't know if there is an alternative (maybe copyfield?) to implement
>> this beahaviour
>>
> Though I am not sure what you want to achieve, yet a copyField is very
> similar to what you are asking for.
>
> Cheers
> Avlesh
>
> 2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>
>
>> Currently we are trying to unmarshall objets from the index (solr bean
>> tags didn't fully acomplish this issue in our project due to model
>> complexity).
>> It will be nice to set an alias for some fields to match the pojo.property
>> name.
>> Don't know if there is an alternative (maybe copyfield?)  to implement
>> this beahaviour
>>
>> thanks
>>
>> 2009/8/18 Avlesh Singh <av...@gmail.com>:
>> > What could possibly be a use case for such a need?
>> >
>> > Cheers
>> > Avlesh
>> >
>> > 2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>
>> >
>> >> Hello everybody,
>> >>
>> >> can i set an alias for a field? Something like :
>> >>
>> >> <field name="sourceDate" type="uniqueIdType" indexed="true"
>> >> stored="true" multiValued="false" termVectors="false"
>> >> alias="source.date"/>
>> >>
>> >> is there any jira issue related?
>> >>
>> >> Thx
>> >>
>> >> --
>> >> Lici
>> >>
>> >
>>
>>
>>
>> --
>> Lici
>>
>



-- 
Lici

Re: Aliases for fields

Posted by Avlesh Singh <av...@gmail.com>.
>
> solr bean tags didn't fully acomplish this issue in our project due to
> model complexity
>
Did you try annotating your pojo in this manner?
@Field("index_field_name)
pojoPropertyName;

It will be nice to set an alias for some fields to match the pojo.property
> name. Don't know if there is an alternative (maybe copyfield?) to implement
> this beahaviour
>
Though I am not sure what you want to achieve, yet a copyField is very
similar to what you are asking for.

Cheers
Avlesh

2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>

> Currently we are trying to unmarshall objets from the index (solr bean
> tags didn't fully acomplish this issue in our project due to model
> complexity).
> It will be nice to set an alias for some fields to match the pojo.property
> name.
> Don't know if there is an alternative (maybe copyfield?)  to implement
> this beahaviour
>
> thanks
>
> 2009/8/18 Avlesh Singh <av...@gmail.com>:
> > What could possibly be a use case for such a need?
> >
> > Cheers
> > Avlesh
> >
> > 2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>
> >
> >> Hello everybody,
> >>
> >> can i set an alias for a field? Something like :
> >>
> >> <field name="sourceDate" type="uniqueIdType" indexed="true"
> >> stored="true" multiValued="false" termVectors="false"
> >> alias="source.date"/>
> >>
> >> is there any jira issue related?
> >>
> >> Thx
> >>
> >> --
> >> Lici
> >>
> >
>
>
>
> --
> Lici
>

Re: Aliases for fields

Posted by Licinio Fernández Maurelo <li...@gmail.com>.
Currently we are trying to unmarshall objets from the index (solr bean
tags didn't fully acomplish this issue in our project due to model
complexity).
It will be nice to set an alias for some fields to match the pojo.property name.
Don't know if there is an alternative (maybe copyfield?)  to implement
this beahaviour

thanks

2009/8/18 Avlesh Singh <av...@gmail.com>:
> What could possibly be a use case for such a need?
>
> Cheers
> Avlesh
>
> 2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>
>
>> Hello everybody,
>>
>> can i set an alias for a field? Something like :
>>
>> <field name="sourceDate" type="uniqueIdType" indexed="true"
>> stored="true" multiValued="false" termVectors="false"
>> alias="source.date"/>
>>
>> is there any jira issue related?
>>
>> Thx
>>
>> --
>> Lici
>>
>



-- 
Lici

Re: Aliases for fields

Posted by Fergus McMenemie <fe...@twig.me.uk>.
>What could possibly be a use case for such a need?
>

I would love to see such a feature.

I have a multi core solr setup with each core having utterly 
different content. Each core has its own "custom search app"
that exploits nuances specific to a particular data set. The
fieldnames are chosen as best fits a particular data set.

However I would also like to have one of two general search
features that span all cores. This is a crude, one size fits
all, type of search:-

One core has fields:-
	author
	title
	text
Another has
	sender
	subject
	message
Another has
	placename
	description

I either need to rename all fields within some of the
"custom search apps" to account for the needs of the global
search or perform lots of copyFields, or construct really
nasty queries. 

I currently use the copyFields approach. I think aliases 
would allow for far more efficient indexes and clear code.

Regards Fergus.

>Cheers
>Avlesh
>
>2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>
>
>> Hello everybody,
>>
>> can i set an alias for a field? Something like :
>>
>> <field name="sourceDate" type="uniqueIdType" indexed="true"
>> stored="true" multiValued="false" termVectors="false"
>> alias="source.date"/>
>>
>> is there any jira issue related?
>>
>> Thx
>>
>> --
>> Lici
>>

-- 

===============================================================
Fergus McMenemie               Email:fergus@twig.me.uk
Techmore Ltd                   Phone:(UK) 07721 376021

Unix/Mac/Intranets             Analyst Programmer
===============================================================

Re: Aliases for fields

Posted by Avlesh Singh <av...@gmail.com>.
What could possibly be a use case for such a need?

Cheers
Avlesh

2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>

> Hello everybody,
>
> can i set an alias for a field? Something like :
>
> <field name="sourceDate" type="uniqueIdType" indexed="true"
> stored="true" multiValued="false" termVectors="false"
> alias="source.date"/>
>
> is there any jira issue related?
>
> Thx
>
> --
> Lici
>

Re: Aliases for fields

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
2009/8/18 Licinio Fernández Maurelo <li...@gmail.com>:
> Hello everybody,
>
> can i set an alias for a field? Something like :
>
> <field name="sourceDate" type="uniqueIdType" indexed="true"
> stored="true" multiValued="false" termVectors="false"
> alias="source.date"/>
>
> is there any jira issue related?
yes https://issues.apache.org/jira/browse/SOLR-1205
>
> Thx
>
> --
> Lici
>



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