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 THADC <ti...@gmail.com> on 2018/08/08 11:17:38 UTC

Can We Alias field "_text_" to "text" in Schema

Hello,

We recently migrated from solr 4.7 to 7.3. We are having a problem with
legacy java code that we do not have control over where searches are coded
to query text as "text". Again, we do not the luxury in this instance to
update the code, so we were wondering whether there is a way to define an
alias field with name _text_ to text.

Any reply is greatly appreciated.

Thanks!



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Can We Alias field "_text_" to "text" in Schema

Posted by Andrea Gazzarini <a....@sease.io>.
Hi,
field names with both leading and trailing underscores are reserved [1] 
so you it would be better to avoid that.
I cannot tell you what exactly the problem is, using such naming; I 
remember I had troubles with function queries, so, in general, I would 
follow that advice.

Best,
Andrea

[1] 
https://lucene.apache.org/solr/guide/6_6/defining-fields.html#DefiningFields-FieldProperties

On 08/08/18 13:17, THADC wrote:
> Hello,
>
> We recently migrated from solr 4.7 to 7.3. We are having a problem with
> legacy java code that we do not have control over where searches are coded
> to query text as "text". Again, we do not the luxury in this instance to
> update the code, so we were wondering whether there is a way to define an
> alias field with name _text_ to text.
>
> Any reply is greatly appreciated.
>
> Thanks!
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: Can We Alias field "_text_" to "text" in Schema

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
You have full control over it. Just change it in managed-schema and
probably in solrconfig.xml and reindex.

In general, you can also alias fields with eDisMax, see
https://lucene.apache.org/solr/guide/7_4/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides
and the example lower down:
f.name.qf=last_name first_name

Regards,
   Alex.

On 8 August 2018 at 07:17, THADC <ti...@gmail.com> wrote:
> Hello,
>
> We recently migrated from solr 4.7 to 7.3. We are having a problem with
> legacy java code that we do not have control over where searches are coded
> to query text as "text". Again, we do not the luxury in this instance to
> update the code, so we were wondering whether there is a way to define an
> alias field with name _text_ to text.
>
> Any reply is greatly appreciated.
>
> Thanks!
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html