You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2015/05/22 05:39:59 UTC

[Solr Wiki] Update of "SpatialForTimeDurations" by DavidSmiley

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SpatialForTimeDurations" page has been changed by DavidSmiley:
https://wiki.apache.org/solr/SpatialForTimeDurations?action=diff&rev1=7&rev2=8

Comment:
Add leading comments about DateRangeField in Solr 5.

- If you need to index multi-value time durations (or any numeric ranges) you may be struggling with how to do this in Solr and search on it properly.  It basically isn't, or should I say, wasn't possible until Solr 4's new spatial support came along, which supports multi-value spatial fields.  Usually, "spatial" is nearly synonymous with "geospatial" but it can be used for other purposes like this too.
+ If you need to index multi-value time durations, then Solr 5.0 has a new field type that supports it: DateRangeField.  For information on how to use DateRangeField, see the Solr Reference Guide: https://cwiki.apache.org/confluence/display/solr/Working+with+Dates
+ 
+ If you have multi-value number ranges that are not times, you're probably best off still using DateRangeField, but encoding your data into a date since that's all that DateRangeField accepts.  DateRangeField is based on spatial technology, but it's optimized for dates.  If you do abuse DateRangeField for non-date data, then, if you can, try to keep the data as a number of seconds instead of milliseconds (use 000 milliseconds).  This limits the numeric space you have to work with, but it will likely perform much better if used this way. It will also perform better if the dates are after the "Gregorian change date" -- October 15th, 1582.  At some point it's likely a NumberRangeField might be developed but that has yet to occur.
+ 
+ If you are not yet using Solr 5, then one of Solr 4's spatial field types can be used for non-spatial means like this... or instead, think of this problem as being turned into a spatial problem.  Usually, "spatial" is nearly synonymous with "geospatial" but it can be used for other purposes like this too.  Read on for more...
  
  First, read Chris Hostetter (aka Hossman)'s illustrated slides from a Solr meetup: 
  [[https://people.apache.org/~hossman/spatial-for-non-spatial-meetup-20130117/|Spatial Search Tricks for People Who Don't Have Spatial Data]].