lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: is there something like NumericalRangeField?
Date Wed, 23 Sep 2015 16:23:03 GMT
You're really mixing text and numeric concepts here:

numeric types are pretty much completely unanalyzed.
The notion of subjecting them to an analysis chain hasn't
been done at all.

You could consider adding an update processor to
your update chain, I suspect the script update processor
is likely a good candidate, see:
https://wiki.apache.org/solr/ScriptUpdateProcessor

Also, for your range stuff this is possibly still a geospatial
problem, anything that can be mapped into a 2 dimensional
space is also possible to use here, but I'm not sure the
sub-fields will work for you. See:
https://wiki.apache.org/solr/SpatialForTimeDurations

Another way, of course, is just to index a
max_num and min_num rather than a range
and form your queries to take advantage of that.

Best,
Erick


On Wed, Sep 23, 2015 at 4:58 AM, Michal Fijolek <michalfijolek91@gmail.com>
wrote:

> Thank for replaying. I have tried with Geo Search, but I cannot managed to
> query documents using edismax, because in GeoSearch one has to use
> Contains, Intersect etc. keywords and I don't know how to put it in edismax
> query...
>
> In my case I just drop prefix from my ranges and it happened to fit Integer
> range in DateRangeField. It works with edismax, so it's a good workaround
> for now, but there are some issues with this missing prefix, but hey, it
> works :)
>
> If I am not mistaken both approaches cannot handle
> some CharFilters like PatternReplaceCharFilterFactory where I
> manipulate prefix in my range data.
>
> Probably I will try to implement some NumericalRangeField, that would
> handle Long ranges and CharFilters. I mean indexing ranges looks like a
> common use-case, so it will be nice to have it working out of the box in
> Solr.
>
> Michal
>
>
> 2015-09-23 11:07 GMT+02:00 Alessandro Benedetti <
> benedetti.alex85@gmail.com>
> :
>
> > TrieLongField should be the other way around, you can index Long data, in
> > the perspective of running efficient range queries on it.
> >
> > But you want to actually index a range, and query for values ( matching
> > only the docs which have valid ranges for that field).
> > Not sure there's something like that Out Of The Box.
> > I think I read a similar topic in the mailing list:
> >
> >
> http://lucene.472066.n3.nabble.com/Solr-How-to-index-range-pair-fields-td4224369.html
> > ,
> >
> >
> http://lucene.472066.n3.nabble.com/Modeling-openinghours-using-multipoints-td4025336.html#a4025683
> >
> > Using Geo Search you should probably be able to achieve that !
> > Keep us updated !
> >
> > Cheers
> >
> >
> >
> > 2015-09-23 7:44 GMT+01:00 Michal Fijolek <michalfijolek91@gmail.com>:
> >
> > > Thanks for replying.
> > > I'm not sure if I can do something like this with TrieLongField.
> > > My solr document:
> > > {
> > >   "myRange": "[10000000000 TO 20000000000]"
> > > }
> > >
> > > And then query it like this:
> > > "myRange":10000000001
> > >
> > > It would fail at importing the document, am I missing something?
> > >
> > > MichaƂ
> > >
> > > 2015-09-23 3:25 GMT+02:00 Adam McElwee <adam@mcelwee.me>:
> > >
> > > > It sounds like you want a TrieLongField, to me. Check it out in the
> > field
> > > > types here -
> > > >
> > > >
> > >
> >
> https://cwiki.apache.org/confluence/display/solr/Field+Types+Included+with+Solr
> > > >
> > > > On Tue, Sep 22, 2015 at 6:31 PM, Michal Fijolek <
> > > michalfijolek91@gmail.com
> > > > >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > > I wanted to use something like DateRangeField, but only for
> numerical
> > > > > ranges, not dates, so I'm looking something like
> NumericalRangeField.
> > > > > I see that DateRangeField works with some numbers up to
> > > > Integer.MAX_VALUE.
> > > > > It's kind of hack, because parsing a year in a method
> > > > > DateRangePrefixTree.parseCalendar(...) looks like this:
> > > > > ```int year = Integer.parseInt(...)```,
> > > > > but in my use-case I need ranges with values greater than
> > > > > Integer.MAX_VALUE, so it does not work. Is there any clean way to
> do
> > > this
> > > > > or maybe I should implement it myself?
> > > > > Thanks
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > --------------------------
> >
> > Benedetti Alessandro
> > Visiting card - http://about.me/alessandro_benedetti
> > Blog - http://alexbenedetti.blogspot.co.uk
> >
> > "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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message