Hi Geert-Jan

I think this discussion is better suited in dev-list than in an issue regarding 
Geo-spatial, so I'm continuing the discussion in this new thread.

Geospatial LatLonType is implemented as a PolyField 
http://wiki.apache.org/solr/SchemaXml#Poly_Field_Types
Another example is MoneyFieldType in SOLR-2202, indexing both a amount value 
and currency type together.

You could probably use Poly Fields for opening hours pairs as well. Imagine a 
TimeRangeFieldType which holds a from-to value between 00:00 and 23:59. And 
then feed a document with from-to pairs:
  <field name="open-mo">0900,1600</field>
  <field name="open-tu">0800,1200</field>
  <field name="open-tu">1400,1900</field>
  <field name="open-we">0900,1600</field>
…

Have no practical experience in programming FieldTypes but I imagine it could 
be done this way, and then be able to query for e.g. open-tu:[1500 TO 1800] to 
find shops open on tuesday from 1500 and three hours..

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

> David, 
> 
> I try not to swamp this discussion, but I have a totally different issue for 
> which I might misuse this patch / LSP. 
> 
> It's about pois having multiple openinghours (depending on day of week, 
> special festivitydays, and sometimes even multiple timeslots per day) 
> I want to query, for example, all pois that are open NOW, and that will 
> remain open until NOW+3H. 
> 
> For background see: 
> http://lucene.472066.n3.nabble.com/multiple-dateranges-timeslots-per-doc-modeling-openinghours-td3368790.html
>  on why all normal approaches don't work (afaik): basically it's about 
> needing multiple opening/closing times and having them be pairwise related.
> 
> I have the feeling that opening/closing datetimes might be modelled as 
> multiple lat/long points. But I would need a query of the form: 
> 
> Given a user defined point x, return all docs that have a point p defined for 
> which: 
> - x.latitude > p.latitude
> - x.longitude < p.longitude
> 
> Is this possible? (As far as I see GeoFilt, BBox, GeoDist don't provide me 
> with what I need)
> 
> Basically this is how I envision encoding it:
> - each <open,closedelta)>-tuple is represented as a (lat/long)point 
> - open is matched on latitude
> - closedelta (closedelta is represented as delta from open) is matched on 
> longitude
> - granularity is 5 minutes
>    - open can be a max of 100 days in future -> ~30.000 distinct values. 
>    - closedelta can be at most 24 hours -> ~300 distinct values
> 
> The above lat/long query applied to the domain would become: 
> Given a user defined open/closedelta-datetime x, return all docs that have a 
> open/close-datetime p defined for which: 
> - x.open > p.open (poi is already open at requested opening time) 
> - x.closedelta  < p.closedelta (poi is not yet closed on the requested 
> closing time) 
> 
> In other words, the poi is open from the requested open-datetime until at 
> least the requested close-datetime.
> 
> Ok, good exercise in writing this down, the question remains is this query 
> possible (perhaps with some coding-efforts)?
> 
> Thanks, 
> Geert-Jan  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to