1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Error on "find older messages" page after elasticsearch 2.0

Discussion in 'Enhanced Search Resolved Bugs' started by estranged, Oct 31, 2015.

  1. estranged

    estranged Well-Known Member

    Hi,

    After upgrading to elasticsearch 2.0 I have started seeing the error below in the logs. Users get the "search could not be completed" error message when they click "Find older messages" in a members profile page.

    Thanks.

    Code:
    XenForo_Exception: Elasticsearch error: {"root_cause":[{"type":"query_parsing_exception","reason":"No query registered for [numeric_range]","index":"x","line":1,"col":131}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"x","node":"2ZWzqYnLSY6kc3z32WqbDQ","reason":{"type":"query_parsing_exception","reason":"No query registered for [numeric_range]","index":"x","line":1,"col":131}}]} - library/XenES/Search/SourceHandler/ElasticSearch.php:872
    Oluşturan: x, 2 dakika önce
    Stack Trace
    #0 /home/x/public_html/library/XenES/Search/SourceHandler/ElasticSearch.php(557): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(Object(stdClass), true)
    #1 /home/x/public_html/library/XenForo/Search/Searcher.php(136): XenES_Search_SourceHandler_ElasticSearch->executeSearchByUserId(102719, 143910497, '500')
    #2 /home/x/public_html/library/XenForo/ControllerPublic/Search.php(360): XenForo_Search_Searcher->searchUser(102719, 143910497)
    #3 /home/x/public_html/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Search->actionMember()
    #4 /home/x/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #5 /home/x/public_html/index.php(13): XenForo_FrontController->run()
    #6 {main}
    Request State
    array(3) {
      ["url"] => string(64) "http://x.com/search/member?user_id=102719&before=143910497"
      ["_GET"] => array(2) {
        ["user_id"] => string(6) "102719"
        ["before"] => string(9) "143910497"
      }
      ["_POST"] => array(0) {
      }
    }
     
    Chris D likes this.
  2. Chris D

    Chris D XenForo Developer Staff Member

    Is this after applying the patch from the other bug fix?
     
  3. estranged

    estranged Well-Known Member

    Not sure. Site was online without the patch for a very short time.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Have you applied the patch? When? When was this error logged? If the patch has been applied, does this error continue to happen?
     
  5. estranged

    estranged Well-Known Member

    I applied the patch right after upgrading to elasticsearch 2.0
     
  6. MattW

    MattW Well-Known Member

    Confirmed on my forum
    Code:
    XenForo_Exception: Elasticsearch error: {"root_cause":[{"type":"query_parsing_exception","reason":"No query registered for [numeric_range]","index":"mattwser_xenforo","line":1,"col":126}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"mattwser_xenforo","node":"6Z1kFrDuTHijufVVKOaW-A","reason":{"type":"query_parsing_exception","reason":"No query registered for [numeric_range]","index":"mattwser_xenforo","line":1,"col":126}}]} - library/XenES/Search/SourceHandler/ElasticSearch.php:872
    Generated By: Matt, A moment ago
    Stack Trace
    #0 /home/nginx/domains/mattwservices.co.uk/public/library/XenES/Search/SourceHandler/ElasticSearch.php(557): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(Object(stdClass), true)
    #1 /home/nginx/domains/mattwservices.co.uk/public/library/XenForo/Search/Searcher.php(136): XenES_Search_SourceHandler_ElasticSearch->executeSearchByUserId(1, 1445714844, '200')
    #2 /home/nginx/domains/mattwservices.co.uk/public/library/XenForo/ControllerPublic/Search.php(360): XenForo_Search_Searcher->searchUser(1, 1445714844)
    #3 /home/nginx/domains/mattwservices.co.uk/public/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Search->actionMember()
    #4 /home/nginx/domains/mattwservices.co.uk/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #5 /home/nginx/domains/mattwservices.co.uk/public/index.php(13): XenForo_FrontController->run()
    #6 {main}
    Request State
    array(3) {
      ["url"] => string(69) "https://mattwservices.co.uk/search/member?user_id=1&before=1445714844"
      ["_GET"] => array(3) {
        ["/search/member"] => string(0) ""
        ["user_id"] => string(1) "1"
        ["before"] => string(10) "1445714844"
      }
      ["_POST"] => array(0) {
      }
    }
     
    Chris D likes this.
  7. Chris D

    Chris D XenForo Developer Staff Member

    Thanks. We'll look into it but it may well not be as quick as the last fix.
     
    MattW likes this.
  8. Daniel Hood

    Daniel Hood Well-Known Member

    Try opening /library/XenEs/Search/SourceHandler/ElasticSearch.php find:
    PHP:
    array('numeric_range' => array('date' => array('lt' => $maxDate)))
    Change to:
    PHP:
    array('range' => array('date' => array('lt' => $maxDate)))
    It seems like they got rid of all their *_range filters and replaced it with one global range filter.

    I haven't tested this as I don't have a board with ElasticSearch installed yet.

    [Edit] Now that it is confirmed to be working, I looked again and it appears to be backwards compatible. Should double check before releasing as a patch, of course.
     
    Last edited: Nov 10, 2015
  9. MattW

    MattW Well-Known Member

    Yep, that fixes it.
     
    Daniel Hood likes this.
  10. PunKeel

    PunKeel Member

    Same bug, same resolution process. Thx ! :)
     
  11. Mike

    Mike XenForo Developer Staff Member

    The general range filter does seem to fix it, and as far as I can tell, is supported by very old versions of Elasticsearch, so that should work for everyone. Thanks!
     
    Daniel Hood and Chris D like this.

Share This Page