[ 
https://issues.apache.org/jira/browse/SOLR-7070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14305965#comment-14305965
 ] 

Hoss Man commented on SOLR-7070:
--------------------------------

this appears to be the same root issue as SOLR-6051.

in that issue it was decided that the appropriate "fix" was to more explicitly 
document that field names starting with numbers were discouraged and would not 
work in all situations.

bq. Anyone know why 1_FOO is interpreted as a function and not a field name? 
Smells like a bug

it's because of the hueristic nature of "fl" parsing and support for numeric 
literals as functions -- eg: {{fl=123,foo,bar,sum(123,yak)}} to request that 
for every document the fields foo & bar be returned, along with a numeric 
constant of "123", and the result of the sum function on the constant 123 and 
the yak field.

as for why field names like this might have worked in 4.6 but stoped working in 
more recent versions: probably due to new features being added to fl parsing 
that tweaked hte hueristic slightly.

we could probably improve the hueristic to do a better job with field names 
like this (i've done that for similar situations in the past) but in SOLR-6051 
it was decided that documentation was a better choice.

alternatively: we could add a DocTransformer for the explicit purpose to 
dealing with funky field names (start with numbers, contain whitespace, contain 
commas, etc...) with a syntax something like...

{noformat}
fl=[field n='123_field'],simple_field_name,[field n='field name with spaces & 
punc\'uation']
{noformat}

> Issue when using "fl" with dynamic filelds without setting wilcards
> -------------------------------------------------------------------
>
>                 Key: SOLR-7070
>                 URL: https://issues.apache.org/jira/browse/SOLR-7070
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.10.3
>            Reporter: Khalid Galal
>              Labels: dynamic, fields
>             Fix For: 4.6
>
>
> Issue when using "fl" with dynamic fields without setting wildcards, such as:
> In solr 4.6, I used to select dynamic fields by exact match, e.g. the below 
> query used to work with me:
> fl=123_PART
> But in solr 4.10.3, the above query doesn't work any more, so I am forced to 
> use a wildcards, such as to be begin with match, e.g. the below query:
> fl=*_PART
> The above query works but returns all dynamic fields that end with "_PART", 
> and that results in bad performance as our dynamic fields are stored.
> Is there any way to be able to select a dynamic field exactly like in version 
> 4.6?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to