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

Erick Erickson commented on SOLR-2745:
--------------------------------------

That is odd. I just reproduced it with 3.3. Here are the field defs (stock Solr 
schema):
<field name="12345e" type="text_ws" indexed="true" />
<field name="12345e_dt" type="date" indexed="true"/>

It happens when sorting on either field. I have one doc in my index with these 
fields, put in this way:
  <field name="12345e">stuff and nonsense is rampant in our society</field>
  <field name="12345e_dt">2010-02-03T00:00:00Z</field>

One other peculiar thing, when I named the fields 8e32_dt and 8e32 it 
succeeded. but 832e and 832e_dt produced the number format exception, a little 
at odds with the original statement, but still.

Why the field #name# should show a number format exception 
is...er...interesting. 

note also that my sort fragment was: &sort=832e_dt, which seems to be getting 
the _dt truncated.

But it's late, so I may be seeing things.

Full stack trace (minus most of the Jetty stuff):

HTTP ERROR 500

Problem accessing /solr/select. Reason:

    For input string: "832e"

java.lang.NumberFormatException: For input string: "832e"
        at 
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1222)
        at java.lang.Double.parseDouble(Double.java:510)
        at 
org.apache.solr.search.QueryParsing$StrParser.getNumber(QueryParsing.java:694)
        at 
org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:293)
        at org.apache.solr.search.FunctionQParser.parse(FunctionQParser.java:67)
        at org.apache.solr.search.QParser.getQuery(QParser.java:142)
        at org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:303)
        at org.apache.solr.search.QParser.getSort(QParser.java:222)
        at 
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:82)
        at 
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
        at 
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
        at 
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
        at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
        at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)



> Sorting on a field whose name resembles an integer in scientific notation
> -------------------------------------------------------------------------
>
>                 Key: SOLR-2745
>                 URL: https://issues.apache.org/jira/browse/SOLR-2745
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 3.3
>            Reporter: Joey
>            Priority: Minor
>
> I have created a schema where the field names are in a uuid format eg: 
> 1cf1691c0-a1a4-4255-8943-57d87c923e31_t. I am also implementing dynamic 
> fields via the 'star underscore' format eg: *_t.
> Whenever I try and sort on a field name that has a format of one or more 
> integers followed by an 'e', I get a NumberFormatException like the 
> following: *java.lang.NumberFormatException: For input string: "8e"*. This 
> particular error comes from trying to sort on a field name 
> *8ecdced6f-3eb4-e508-4e7d-d40a86305096_dt*. If the field name started with 
> 12345e, I would get an error *java.lang.NumberFormatException: For input 
> string: "12345e"*.
> I'm not sure if this is a major issue or not but it is something that has 
> appeared in our testing quite often. You would be surprised at how often 
> randomly generated uuid's start with a number and then 'e'...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to