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

Hoss Man commented on SOLR-1270:
--------------------------------


* FloatField is doing what it's suppose to (being fast and trusting the user 
input)
* JSONWriter is doing what it's suppose to (being fast and trusting that the 
data in the fields is valid.

The only way (i know of) to get invalid JSON output from the JSONWriter from a 
numeric field is for the client to index invalid data.

Garbage in, Garbage out.

If there is a way to make JSONWriter error on a *legal* float value, then there 
is a bug in JSONWriter and we should fix it.  but if the problem is users 
indexing bogus data, then either the users should clean up their data, or we 
should add a "ParanoidFloatField" that validates the input (at the expense of 
performance).

If you have suggestions for documentation improvements to make users more aware 
of their responsibilities when using FloatField (and IntField, etc...) they 
would definitely be appreciated.



> The FloatField (and probably others) field type takes any string value at 
> index, but JSON writer outputs as numeric without checking
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1270
>                 URL: https://issues.apache.org/jira/browse/SOLR-1270
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.2, 1.3, 1.4
>         Environment: ubuntu 8.04, sun java 6, tomcat 5.5
>            Reporter: Donovan Jimenez
>            Priority: Minor
>
> The FloatField field type takes any string value at index. These values 
> aren't necessarily in JSON numeric, but the JSON writer does not check its 
> validity before writing it out as a JSON numeric.
> I'm aware of the SortableFloatField which does do index time verification and 
> conversion of the value, but the way the JSON writer is working seemed like 
> either a bug that needed addressed or perhaps a gotch that needs better 
> documented?
> This issue originally came from my php client issue tracker: 
> http://code.google.com/p/solr-php-client/issues/detail?id=13

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

Reply via email to