It might be nice to have a specialized update processor for this common
case of wanting to specify two separate but related numeric fields using
one string. IOW, parse out two numbers and then send them to two separate
fields. Seems doable, either as a script or in Java. The script/processor
could take three field names and a flag: the raw input source, the two
destination fields, and whether the raw source field should be removed or
passed through (presumably into a text/string field.)

(If I was still updating my old Solr 4.x Deep Dive book I'd be adding that
script right now, but... that's not happening.)

-- Jack Krupansky

On Fri, Mar 11, 2016 at 11:03 AM, Alessandro Benedetti <
abenede...@apache.org> wrote:

> I agree with Upayavira,
> this is an information extraction task, you need to implement your logic to
> extract the proper numeric values from the textual field.
> Your update request processor could be as simple as you want in extracting
> the number and setting them in numeric fields.
> So this task is responsibility of a component that process the original
> field value.
> It is not responsibility of the tdouble field type.
>
> Cheers
>
> On 11 March 2016 at 15:29, Upayavira <u...@odoko.co.uk> wrote:
>
> >
> >
> > On Fri, 11 Mar 2016, at 03:19 PM, John Blythe wrote:
> > > hey all,
> > >
> > > i'm tossing a lot of mud against the wall and am wanting to see what
> > > sticks. part of that includes throwing item descriptions against some
> > > fields i've set up as doubles. the imported data is a double and some
> of
> > > the descriptions will have the related data within it (product sizes,
> > > e.g.
> > > "Super awesome product 10 x 20cm"). is there a way to throw text at a
> > > number field (tdouble) and it only analyze the numbers instead of
> > > throwing
> > > an error?
> > >
> > > thanks for any info!
> >
> > If you really must do that on the Solr side, I'd suggest you try doing
> > it in an UpdateProcessor. You can either code these in Java, or in a
> > scripting language with the StatelessScriptUpdateProcessor. You could
> > strip out all of the non-numeric characters before they get to the
> > index.
> >
> > Upayavira
> >
>
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England
>

Reply via email to