You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Ryan McKinley (JIRA)" <ji...@apache.org> on 2009/05/15 21:49:45 UTC

[jira] Created: (SOLR-1171) dynamic field name with spaces causes error

dynamic field name with spaces causes error
-------------------------------------------

                 Key: SOLR-1171
                 URL: https://issues.apache.org/jira/browse/SOLR-1171
             Project: Solr
          Issue Type: Bug
            Reporter: Ryan McKinley
             Fix For: 1.4


Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:

{panel}
May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: undefined field Value
	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
{panel}

note the field is "meta_set_gdal_NoData Value" not "Value"

I think the query parser is grabbing it...



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1171) dynamic field name with spaces causes error

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710156#action_12710156 ] 

Yonik Seeley commented on SOLR-1171:
------------------------------------

bq. Should field names with spaces be supported? Are they supported in Lucene (ignoring the lack of support by the QP)? 

There are no fieldname restrictions in Lucene.  We've not specifically disallowed any in Solr, but IMO it's generally best to stick with valid identifiers in common languages.

> dynamic field name with spaces causes error
> -------------------------------------------
>
>                 Key: SOLR-1171
>                 URL: https://issues.apache.org/jira/browse/SOLR-1171
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan McKinley
>             Fix For: 1.4
>
>
> Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:
> {panel}
> May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: undefined field Value
> 	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
> 	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
> 	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
> 	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
> 	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
> 	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
> 	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
> 	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
> {panel}
> note the field is "meta_set_gdal_NoData Value" not "Value"
> I think the query parser is grabbing it...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1171) dynamic field name with spaces causes error

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729462#action_12729462 ] 

Ryan McKinley commented on SOLR-1171:
-------------------------------------

thanks hoss!

> dynamic field name with spaces causes error
> -------------------------------------------
>
>                 Key: SOLR-1171
>                 URL: https://issues.apache.org/jira/browse/SOLR-1171
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan McKinley
>            Assignee: Hoss Man
>             Fix For: 1.4
>
>
> Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:
> {panel}
> May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: undefined field Value
> 	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
> 	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
> 	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
> 	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
> 	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
> 	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
> 	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
> 	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
> {panel}
> note the field is "meta_set_gdal_NoData Value" not "Value"
> I think the query parser is grabbing it...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1171) dynamic field name with spaces causes error

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721994#action_12721994 ] 

Hoss Man commented on SOLR-1171:
--------------------------------

bq. lthough solr does not enforce field name restrictions adding spaces makes a few things not work. It seems better to make the restriction explicit rather then wait for things to go wrong.

eh ... some features may not work if your field names contain spaces, but that doesn't mean we should make it an error to try and do it if you don't use those features.  The Elevation component requires you have a uniqueKey, but that doesn't mean uniqueKeys are mandatory for all indexes -- it just means thta feature is smart enough to check when it's prereqs aren't met.  QueryParser doesn't support "special charcters" in field names, but that doesn't mean we should explicitly forbid them.

I don't even understand why LukeRequestHandler is using QueryParser ... it's just building an unbounded RangeQuery to find out how many documents contain this field... that can be done without parsing.

> dynamic field name with spaces causes error
> -------------------------------------------
>
>                 Key: SOLR-1171
>                 URL: https://issues.apache.org/jira/browse/SOLR-1171
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan McKinley
>             Fix For: 1.4
>
>
> Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:
> {panel}
> May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: undefined field Value
> 	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
> 	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
> 	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
> 	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
> 	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
> 	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
> 	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
> 	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
> {panel}
> note the field is "meta_set_gdal_NoData Value" not "Value"
> I think the query parser is grabbing it...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1171) dynamic field name with spaces causes error

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710143#action_12710143 ] 

Otis Gospodnetic commented on SOLR-1171:
----------------------------------------

Should field names with spaces be supported?  Are they supported in Lucene (ignoring the lack of support by the QP)?



> dynamic field name with spaces causes error
> -------------------------------------------
>
>                 Key: SOLR-1171
>                 URL: https://issues.apache.org/jira/browse/SOLR-1171
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan McKinley
>             Fix For: 1.4
>
>
> Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:
> {panel}
> May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: undefined field Value
> 	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
> 	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
> 	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
> 	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
> 	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
> 	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
> 	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
> 	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
> {panel}
> note the field is "meta_set_gdal_NoData Value" not "Value"
> I think the query parser is grabbing it...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-1171) dynamic field name with spaces causes error

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man resolved SOLR-1171.
----------------------------

    Resolution: Fixed
      Assignee: Hoss Man

This bug was even more heinous then it seems at first blush ... if you use dynamic fields with a *suffix* it failed silently, giving you a bogus doc count.  A field name like "name with spaces_t" resulted in a query for "name with spaces_t:[* TO *]" which would give you the count of docs with a value in the "spaces_t" field *or* contained "name" or "with" in the defaultSearchField.

Committed revision 792751.


> dynamic field name with spaces causes error
> -------------------------------------------
>
>                 Key: SOLR-1171
>                 URL: https://issues.apache.org/jira/browse/SOLR-1171
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan McKinley
>            Assignee: Hoss Man
>             Fix For: 1.4
>
>
> Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:
> {panel}
> May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: undefined field Value
> 	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
> 	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
> 	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
> 	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
> 	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
> 	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
> 	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
> 	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
> {panel}
> note the field is "meta_set_gdal_NoData Value" not "Value"
> I think the query parser is grabbing it...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1171) dynamic field name with spaces causes error

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710509#action_12710509 ] 

Ryan McKinley commented on SOLR-1171:
-------------------------------------

Although solr does not enforce field name restrictions adding spaces makes a few things not work.  It seems better to make the restriction explicit rather then wait for things to go wrong.

In any case, the LukeHandler should at least catch the exception and default to a Term query...  Luke should be able to show any index -- even if it was not created with solr.

> dynamic field name with spaces causes error
> -------------------------------------------
>
>                 Key: SOLR-1171
>                 URL: https://issues.apache.org/jira/browse/SOLR-1171
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan McKinley
>             Fix For: 1.4
>
>
> Stumbled into this bug.  I have a dynamic field "meta_set_*"  When I add the field:  "meta_set_NoData Value" and try to open luke, I get this exception:
> {panel}
> May 15, 2009 3:42:06 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: undefined field Value
> 	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1132)
> 	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1094)
> 	at org.apache.solr.search.SolrQueryParser.getRangeQuery(SolrQueryParser.java:121)
> 	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1514)
> 	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1349)
> 	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1306)
> 	at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1266)
> 	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:172)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexedFieldsInfo(LukeRequestHandler.java:310)
> 	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:147)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1330)
> {panel}
> note the field is "meta_set_gdal_NoData Value" not "Value"
> I think the query parser is grabbing it...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.