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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

THADC
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
Reply | Threaded
Open this post in threaded view
|

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

Andrea Gazzarini-6
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

Reply | Threaded
Open this post in threaded view
|

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

Alexandre Rafalovitch
In reply to this post by THADC
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 <[hidden email]> 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