[
https://issues.apache.org/jira/browse/SOLR-2719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222408#comment-13222408
]
Yonik Seeley commented on SOLR-2719:
------------------------------------
bq. Yonik, I see your point. On the other hand, the dash is a widely used
character within field names. The regression is on the Solr behaviour, and I
think it's pretty annoying from a user perspective.
The easiest way to handle this would be this code in ReturnFields:
{code}
// short circuit test for a really simple field name
String key = null;
String field = sp.getId(null);
char ch = sp.ch();
{code}
Instead of using getId, we should hand-roll something that also accepts "-" as
part of the field name. That would leave function parser (and other users of
getId) alone, but allow fieldnames with dashes in the fl param.
bq. What matters more than anything else is consistency.
If we really want to go for consistency, then we should not accept "-" anywhere
(rather than attempting to expand it to everywhere).
> REGRESSION ReturnFields incorrect parse fields with hyphen - breaks existing
> "fl=my-field-name" type usecases
> -------------------------------------------------------------------------------------------------------------
>
> Key: SOLR-2719
> URL: https://issues.apache.org/jira/browse/SOLR-2719
> Project: Solr
> Issue Type: Bug
> Components: search
> Affects Versions: 4.0
> Reporter: Nik V. Babichev
> Priority: Blocker
> Labels: field, fl, query, queryparser
> Fix For: 4.0
>
> Attachments: SOLR-2719.patch
>
>
> fl=my-hyphen-field in query params parsed as "my" instead of
> "my-hyphen-field".
> OAS.search.ReturnFields use method getId() from OAS.search.QueryParsing
> in which check chars "if (!Character.isJavaIdentifierPart(ch) && ch != '.')"
> Hyphen is not JavaIdentifierPart and this check break when first "-" is found.
> This problem solve by passing '-' to check:
> if (!Character.isJavaIdentifierPart(ch) && ch != '.' && ch != '-') break;
> But I don't know how it can affect on whole project.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]