Modeling openinghours using multipoints

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Modeling openinghours using multipoints

gbrits
Hi David and all,

Over a year ago I posted a usecase to, the in this context familiar, issue SOLR-2155 of modelling openinghours using multivalued points.

https://issues.apache.org/jira/browse/SOLR-2155?focusedCommentId=13114839&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13114839

David gave two possible solutions that would work, but I'm wondering if the latest advancements in spatial search have made a more straightforward implementation possible.

The crux:
 - A venue can have multiple openinghours (depending on day of week, special festivitydays, and sometimes even multiple timeslots per day)
 - queries like the following should be possible: "which venues are open at least for the following timespan: [NOW, NOW+3h] " Or [this monday 6h, this monday 11pm]
 - no need to search in the past.

To me this an [open,close]-timespan could be nicely modelled as a point, thus all openinghours of a venue could be defined as multiple points. (multivalued points, multipoint, shape, not sure on the recent nomenclature)

In the open/close domain the general query would be:
Given a user defined query Q(open,close): return all venues that have a timespan T(open,close) (out of many timespans) for which the following holds:
q.open <= T.open AND T.close <=q.close

Mapping 'open' to latitude and 'close' to longitude results in:

Given a user defined point X, return all docs that have a point P defined (out of many points) for which the following holds:
X.latitude <= P.latitude AND P.longitude <=X.longitude

The question: Is such a query on multipoints now doable out-of-the-box with spatial4j (or any other supported plugin for that matter) ?

Any help highly appreciated!

Kind regards,
Geert-Jan.

Oh btw: the idea behind the translation-function becomes easy as I don't need to search dates in the past. Moreover, a reindex takes place every night meaning today 0AM could be defined as 0. With a granularity of 15 minutes and wanting to search 100 days ahead: the transform is simply mapping 9600 intervals (100*24*4) both for open and close onto [-90,90] and [0,180] respectively.


Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Modeling openinghours using multipoints

dsmiley
Geert-Jan,

Please ask again on the solr-user list and CC me to ensure I see it.  I'm trying to encourage questions being asked & answered in the correct venue.  Spatial4j is more shape oriented whereas this is more search oriented (yeah it's a fuzzy line sometimes).  I haven't been good about this in the past but I want to do the right thing now.

~ David


On Sat, Dec 8, 2012 at 8:00 AM, gbrits <[hidden email]> wrote:
Hi David and all,

Over a year ago I posted a usecase to, the in this context familiar, issue
SOLR-2155 of modelling openinghours using multivalued points.

https://issues.apache.org/jira/browse/SOLR-2155?focusedCommentId=13114839&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13114839

David gave two possible solutions that would work, but I'm wondering if the
latest advancements in spatial search have made a more straightforward
implementation possible.

The crux:
 - A venue can have multiple openinghours (depending on day of week, special
festivitydays, and sometimes even multiple timeslots per day)
 - queries like the following should be possible: "which venues are open at
least for the following timespan: [NOW, NOW+3h] " Or [this monday 6h, this
monday 11pm]
 - no need to search in the past.

To me this an [open,close]-timespan could be nicely modelled as a point,
thus all openinghours of a venue could be defined as multiple points.
(multivalued points, multipoint, shape, not sure on the recent nomenclature)

In the open/close domain the general query would be:
Given a user defined query Q(open,close): return all venues that have a
timespan T(open,close) (out of many timespans) for which the following
holds:
q.open <= T.open AND T.close <=q.close

Mapping 'open' to latitude and 'close' to longitude results in:

Given a user defined point X, return all docs that have a point P defined
(out of many points) for which the following holds:
X.latitude <= P.latitude AND P.longitude <=X.longitude

The question: Is such a query on multipoints now doable out-of-the-box with
spatial4j (or any other supported plugin for that matter) ?

Any help highly appreciated!

Kind regards,
Geert-Jan.

Oh btw: the idea behind the translation-function becomes easy as I don't
need to search dates in the past. Moreover, a reindex takes place every
night meaning today 0AM could be defined as 0. With a granularity of 15
minutes and wanting to search 100 days ahead: the transform is simply
mapping 9600 intervals (100*24*4) both for open and close onto [-90,90] and
[0,180] respectively.






--
View this message in context: http://spatial4j.16575.n6.nabble.com/Modeling-openinghours-using-multipoints-tp5001108.html
Sent from the Spatial4j mailing list archive at Nabble.com.
_______________________________________________
dev mailing list
[hidden email]
http://lists.spatial4j.com/listinfo.cgi/dev-spatial4j.com


_______________________________________________
dev mailing list
[hidden email]
http://lists.spatial4j.com/listinfo.cgi/dev-spatial4j.com
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Modeling openinghours using multipoints

gbrits