Hi Edwin, That's correct. I would like to have one field that stores a *range* of Integers, like field=[100 TO 250]. And my query might contain a range. If there's any overlap, I need the document returned.
I did come across this in Lucene: https://lucene.apache.org/core/7_2_1/core/org/apache/lucene/document/IntRange.html And it's exactly what I'm looking for but unfortunately adding a fieldType with this class in Solr didn't work for me. On Thu, Mar 7, 2019 at 1:53 PM Zheng Lin Edwin Yeo <edwinye...@gmail.com> wrote: > Hi, > > Do you mean you plan to index a range of number into a single field? > > Regards, > Edwin > > On Wed, 6 Mar 2019 at 17:53, Ryan Yacyshyn <ryan.yacys...@gmail.com> > wrote: > > > Hi all, > > > > Is there a way I can perform a filter query on a field that contains a > > numeric range? Very much like how we can query over a date range: > > > > > > > https://lucene.apache.org/solr/guide/7_3/working-with-dates.html#more-daterangefield-details > > > > I'd like to index documents that have a field containing a range of > > integers, such as: > > > > doc 1 --> { my_field: [200 TO 250] } > > doc 2 --> { my_field: [240 TO 270] } > > > > And then have a query such as fq={!field f=my_field op=Contains}[210 TO > > 230] to return the first doc. This is possible with Dates, can I do > > something like this with integers? > > > > Couldn't find much online on this, if anyone can point me in the right > > direction that would be great! > > > > Ryan > > >