lucene-ruby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiago Jackiw" <tjac...@gmail.com>
Subject Re: Solr-ruby crashing "(eval):1: Illegal octal digit"
Date Wed, 17 Oct 2007 17:36:53 GMT
Yeah unfortunately I can't change that field, it has to be kept as
integer. And also I don't think it would make any difference because
when you eval the string "08817" or the number 08817 they both get the
same error.

Thiago


On 10/17/07, Yonik Seeley <yonik@apache.org> wrote:
> On 10/17/07, Yonik Seeley <yonik@apache.org> wrote:
> > On 10/17/07, Thiago Jackiw <tjackiw@gmail.com> wrote:
> > > For some reason solr-ruby is crashing when returning the response
> > > below. It works fine if I try the same query directly without using
> > > solr-ruby. Any ideas?
> > >
> > > Query:
> > > ?wt=ruby&fl=zip_code&q=accounting
> > >
> > > Response:
> > > {'responseHeader'=>{'status'=>0,'QTime'=>1,'params'=>{'wt'=>'ruby','rows'=>'1','start'=>'5','q'=>'accounting','fl'=>'zip_code','qt'=>'standard'}},'response'=>{'numFound'=>15005,'start'=>5,'docs'=>[{'zip_code'=>[08817]}]}}
> > >
> > > Error message:
> > > solr/response/ruby.rb:30:in `initialize': invalid ruby code:
> > > (eval):1:in `initialize': compile error (Solr::Exception) (eval):1:
> > > Illegal octal digit
> >
> > It's complaining about the 08817 (an octal constant, not a decimal one...)
> > Solr returned this???  What's the fieldType of zip_code?
>
> Ah, I bet zip_code could be of type "integer" which just stores the
> text representation of a number, and you probably indexed "08817"
> which solr faithfully spit back out.  As Erik says, you probably want
> a string type for this to preserve leading zeros and allow dashes.
> You should be able to change the type of the field in the schema and
> not have to reindex (since they are "compatible").
>
> -Yonik
>

Mime
View raw message