You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2013/05/08 21:29:52 UTC
Re: Numeric fields and payload
: is it possible to store (text) payload to numeric fields (class
: solr.TrieDoubleField)? My goal is to store measure units to numeric
: features - e.g. '1.5 cm' - and to use faceted search with these fields.
: But the field type doesn't allow analyzers to add the payload data. I
: want to avoid database access to load the units. I'm using Solr 4.2 .
I'm not sure if it's possible to add payloads to Trie fields, but even if
there is i don't think you really want that for your usecase -- i think it
would make a lot more sense to normalize your units so you do consistent
sorting, range queries, and faceting on the values regardless of wether
it's 100cm or 1000mm or 1m.
-Hoss
Re: Numeric fields and payload
Posted by Erick Erickson <er...@gmail.com>.
Peter:
I don't quite get this. Formatting to display is trivial as it's
usually done for just a few docs anyway. You could also
just store the original unaltered value and add an additional
"normalized" field.
Best
Erick
On Wed, Sep 4, 2013 at 2:02 PM, PETER LENAHAN <pe...@ibi.com> wrote:
> Chris Hostetter <hossman_lucene <at> fucit.org> writes:
>
> >
> >
> > : is it possible to store (text) payload to numeric fields (class
> > : solr.TrieDoubleField)? My goal is to store measure units to numeric
> > : features - e.g. '1.5 cm' - and to use faceted search with these fields.
> > : But the field type doesn't allow analyzers to add the payload data. I
> > : want to avoid database access to load the units. I'm using Solr 4.2 .
> >
> > I'm not sure if it's possible to add payloads to Trie fields, but even if
> > there is i don't think you really want that for your usecase -- i think
> it
> > would make a lot more sense to normalize your units so you do consistent
> > sorting, range queries, and faceting on the values regardless of wether
> > it's 100cm or 1000mm or 1m.
> >
> > -Hoss
> >
> >
>
> Hoss, What you suggest may be fine for specific units. But for monetary
> values with formatting it is not realistic. $10,000.00 would require
> formatting the number to display it. It would be much easier to store the
> string as a payload with the formatted value.
>
>
> Peter Lenahan
>
>
Re: Numeric fields and payload
Posted by PETER LENAHAN <pe...@ibi.com>.
Chris Hostetter <hossman_lucene <at> fucit.org> writes:
>
>
> : is it possible to store (text) payload to numeric fields (class
> : solr.TrieDoubleField)? My goal is to store measure units to numeric
> : features - e.g. '1.5 cm' - and to use faceted search with these fields.
> : But the field type doesn't allow analyzers to add the payload data. I
> : want to avoid database access to load the units. I'm using Solr 4.2 .
>
> I'm not sure if it's possible to add payloads to Trie fields, but even if
> there is i don't think you really want that for your usecase -- i think it
> would make a lot more sense to normalize your units so you do consistent
> sorting, range queries, and faceting on the values regardless of wether
> it's 100cm or 1000mm or 1m.
>
> -Hoss
>
>
Hoss, What you suggest may be fine for specific units. But for monetary
values with formatting it is not realistic. $10,000.00 would require
formatting the number to display it. It would be much easier to store the
string as a payload with the formatted value.
Peter Lenahan