#100 ✓resolved
Sandy

Bounding Box Error

Reported by Sandy | March 22nd, 2010 @ 02:35 AM | in Bugs

With the new update to solr spatial light (1.0.5) the radius based queries are working great. However, this tends to break the bounding box search approach as detailed:

http://groups.google.com.au/group/ruby-sunspot/browse_thread/thread...

  • In your search definition, include these definitions:
    Sunspot.setup(Post) do
    float :lat, :trie => true
    float :lng, :trie => true
    coordinates { [lat, lng] }
    end
    
    bounded_search = Sunspot.search(Post) do
    with(:lat).between(sw.lat .. ne.lat)
    with(:lng).between(sw.lng .. ne.lng)
    end
    

Which gives:

search = Sunspot.search(Event) { with(:lng).between(0.00 .. 180.00)}
=> RSolr::RequestError: Solr Response: nulljavalangNullPointerExceptionat_meoutoftisolrspatiallightSpatialQueryComponentaddDistancesToResponseSpatialQueryComponentjava194at_meoutoftisolrspatiallightSpatialQueryComponentprocessSpatialQueryComponentjava139at_orgapachesolrhandlercomponentSearchHandlerhandleRequestBodySearchHandlerjava195at_orgapachesolrhandlerRequestHandlerBasehandleRequestRequestHandlerBasejava131at_orgapachesolrcoreSolrCoreexecuteSolrCorejava1316at_orgapachesolrservletSolrDispatchFilterexecuteSolrDispatchFilterjava338at_orgapachesolrservletSolrDispatchFilterdoFilterSolrDispatchFilterjava241at_orgmortbayjettyservletServletHandler$CachedChaindoFilterServletHandlerjava1089at_orgmortbayjettyservletServletHandlerhandleServletHandlerjava365at_orgmortbayjettysecuritySecurityHandlerhandleSecurityHandlerjava216at_orgmortbayjettyservletSessionHandlerhandleSessionHandlerjava181at_orgmortbayjettyhandlerContextHandlerhandleContextHandlerjava712at_orgmortbayjettywebappWebAppContexthandleWebAppContextjava405at_orgmortbayjettyhandlerContextHandlerCollectionhandleContextHandlerCollectionjava211at_orgmortbayjettyhandlerHandlerCollectionhandleHandlerCollectionjava114at_orgmortbayjettyhandlerHandlerWrapperhandleHandlerWrapperjava139at_orgmortbayjettyServerhandleServerjava285at_orgmortbayjettyHttpConnectionhandleRequestHttpConnectionjava502at_orgmortbayjettyHttpConnection$RequestHandlerheaderCompleteHttpConnectionjava821at_orgmortbayjettyHttpParserparseNextHttpParserjava513at_orgmortbayjettyHttpParserparseAvailableHttpParserjava208at_orgmortbayjettyHttpConnectionhandleHttpConnectionjava378at_orgmortbayjettybioSocketConnector$ConnectionrunSocketConnectorjava226_at_orgmortbaythreadBoundedThreadPool$PoolThreadrunBoundedThreadPooljava442

OR

search = Sunspot.search(Event) { with(:lat).between(-90.00 .. 90.00)}
=> RSolr::RequestError: Solr Response: null__javalangNullPointerException__at_meoutoftisolrspatiallightSpatialQueryComponentaddDistancesToResponseSpatialQueryComponentjava194__at_meoutoftisolrspatiallightSpatialQueryComponentprocessSpatialQueryComponentjava139__at_orgapachesolrhandlercomponentSearchHandlerhandleRequestBodySearchHandlerjava195__at_orgapachesolrhandlerRequestHandlerBasehandleRequestRequestHandlerBasejava131__at_orgapachesolrcoreSolrCoreexecuteSolrCorejava1316__at_orgapachesolrservletSolrDispatchFilterexecuteSolrDispatchFilterjava338__at_orgapachesolrservletSolrDispatchFilterdoFilterSolrDispatchFilterjava241__at_orgmortbayjettyservletServletHandler$CachedChaindoFilterServletHandlerjava1089__at_orgmortbayjettyservletServletHandlerhandleServletHandlerjava365__at_orgmortbayjettysecuritySecurityHandlerhandleSecurityHandlerjava216__at_orgmortbayjettyservletSessionHandlerhandleSessionHandlerjava181__at_orgmortbayjettyhandlerContextHandlerhandleContextHandlerjava712__at_orgmortbayjettywebappWebAppContexthandleWebAppContextjava405__at_orgmortbayjettyhandlerContextHandlerCollectionhandleContextHandlerCollectionjava211__at_orgmortbayjettyhandlerHandlerCollectionhandleHandlerCollectionjava114__at_orgmortbayjettyhandlerHandlerWrapperhandleHandlerWrapperjava139__at_orgmortbayjettyServerhandleServerjava285__at_orgmortbayjettyHttpConnectionhandleRequestHttpConnectionjava502__at_orgmortbayjettyHttpConnection$RequestHandlerheaderCompleteHttpConnectionjava821__at_orgmortbayjettyHttpParserparseNextHttpParserjava513__at_orgmortbayjettyHttpParserparseAvailableHttpParserjava208__at_orgmortbayjettyHttpConnectionhandleHttpConnectionjava378__at_orgmortbayjettybioSocketConnector$ConnectionrunSocketConnectorjava226__at_orgmortbaythreadBoundedThreadPool$PoolThreadrunBoundedThreadPooljava442_

Comments and changes to this ticket

  • Sandy

    Sandy March 22nd, 2010 @ 03:05 AM

    The error seems to pop up on all search instances that do no have a query with a spatial parameter. It seems like the mirror of what was happening when a distance value wasn't assigned to each hits instance.\

    Sunspot.search(Event) {keywords('the')}
    => RSolr::RequestError: Solr Response: null__javalangNullPointerException__at_meoutoftisolrspatiallightSpatialQueryComponentaddDistancesToResponseSpatialQueryComponentjava194__at_meoutoftisolrspatiallightSpatialQueryComponentprocessSpatialQueryComponentjava139__at_orgapachesolrhandlercomponentSearchHandlerhandleRequestBodySearchHandlerjava195__at_orgapachesolrhandlerRequestHandlerBasehandleRequestRequestHandlerBasejava131__at_orgapachesolrcoreSolrCoreexecuteSolrCorejava1316__at_orgapachesolrservletSolrDispatchFilterexecuteSolrDispatchFilterjava338__at_orgapachesolrservletSolrDispatchFilterdoFilterSolrDispatchFilterjava241__at_orgmortbayjettyservletServletHandler$CachedChaindoFilterServletHandlerjava1089__at_orgmortbayjettyservletServletHandlerhandleServletHandlerjava365__at_orgmortbayjettysecuritySecurityHandlerhandleSecurityHandlerjava216__at_orgmortbayjettyservletSessionHandlerhandleSessionHandlerjava181__at_orgmortbayjettyhandlerContextHandlerhandleContextHandlerjava712__at_orgmortbayjettywebappWebAppContexthandleWebAppContextjava405__at_orgmortbayjettyhandlerContextHandlerCollectionhandleContextHandlerCollectionjava211__at_orgmortbayjettyhandlerHandlerCollectionhandleHandlerCollectionjava114__at_orgmortbayjettyhandlerHandlerWrapperhandleHandlerWrapperjava139__at_orgmortbayjettyServerhandleServerjava285__at_orgmortbayjettyHttpConnectionhandleRequestHttpConnectionjava502__at_orgmortbayjettyHttpConnection$RequestHandlerheaderCompleteHttpConnectionjava821__at_orgmortbayjettyHttpParserparseNextHttpParserjava513__at_orgmortbayjettyHttpParserparseAvailableHttpParserjava208__at_orgmortbayjettyHttpConnectionhandleHttpConnectionjava378__at_orgmortbayjettybioSocketConnector$ConnectionrunSocketConnectorjava226__at_orgmortbaythreadBoundedThreadPool$PoolThreadrunBoundedThreadPooljava442_
    
  • mat

    mat March 22nd, 2010 @ 09:35 AM

    • Milestone set to Bugs
  • mat

    mat March 22nd, 2010 @ 09:42 AM

    Ack, sorry, awful bug. Will push a new build shortly.

  • mat

    mat March 22nd, 2010 @ 09:45 AM

    • State changed from “new” to “resolved”

    (from [5e1a6df7642d67399d577640d35c545bd6782a29]) Update solr-spatial-light to 0.0.6 build

    Fixes error when attempting to build distances in non-spatial search.

    [#100 state:resolved] http://github.com/outoftime/sunspot/commit/5e1a6df7642d67399d577640...

  • Sandy

    Sandy March 23rd, 2010 @ 12:39 AM

    Great! Thanks again. Everything is working great now.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Awesome Solr interaction for Ruby

People watching this ticket

Referenced by

Pages