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

Empty result sets?

shawn

Well-known member
#1
Anybody else having a problem with running a search query and getting zero results? If I search a second time for the same exact thing, it'll come back with 900 responses.

I'm guessing there's a timeout variable that needs to be a bit longer than it currently is...?
 

shawn

Well-known member
#4
Does the server error log show anything up?
Not when it happens, no. I do have a couple of the "No response from Elasticsearch" errors, but they weren't logged when this happened. I'm going to force IP/port for that stuff tonight.
 

shawn

Well-known member
#5
I checked the elasticsearch port and IP information. I already had it forced to an IP and port in both the elasticsearch config and in XF, so I'm not sure why I'm getting the "No response" errors.
 

CyclingTribe

Well-known member
#6
Okay, well here's the report I get in the XF error log:

Code:
XenForo_Exception: Elasticsearch server returned no response. Is it running? - library/XenES/Search/SourceHandler/ElasticSearch.php:721
Generated By: Bluenite, Today at 03:41
Stack Trace
#0 /**path**/library/XenES/Search/SourceHandler/ElasticSearch.php(200): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(false, true)
#1 /**path**/library/XenForo/Search/SourceHandler/Abstract.php(115): XenES_Search_SourceHandler_ElasticSearch->executeSearch('giant defy', false, Array, Array, false, '600')
#2 /**path**/library/XenForo/Search/Searcher.php(79): XenForo_Search_SourceHandler_Abstract->searchGeneral('giant defy', Array, 'date', '600')
#3 /**path**/library/XenForo/ControllerPublic/Search.php(230): XenForo_Search_Searcher->searchGeneral('giant defy', Array, 'date')
#4 /**path**/library/XenForo/FrontController.php(310): XenForo_ControllerPublic_Search->actionSearch()
#5 /**path**/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /**path**/index.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
  ["url"] => string(38) "http://www.cyclechat.net/search/search"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["keywords"] => string(10) "giant defy"
    ["users"] => string(0) ""
    ["date"] => string(0) ""
    ["_xfToken"] => string(57) "19993,1330573295,16d0393271f3232eb91408b885683343bf4cc09e"
  }
}
 

CyclingTribe

Well-known member
#7
Always the same error - never the same search term - and other than a few of these a day it's working perfectly.

I have results set to 900 so that old posts appear in the search results, which slows it a little compared to the default 300 posts - but I don't think that's the issue.

Anyway, hope this helps if we're both experiencing the same thing?

Cheers,
Shaun :D
 

Slavik

XenForo moderator
Staff member
#8
It almost seems that if a search as not been done for a while the ES/Java client goes to idle, and the first search wakes it up, but in the proccess it returns no result for that first search.

Possibly set up a shell script to run every few minutes just calling back to ES via curl to keep it alive and see if that helps?
 

shawn

Well-known member
#9
Slavik, what would the script need to say?

Here's my error:

Code:
Error Info
XenForo_Exception: Elasticsearch server returned no response. Is it running? - library/XenES/Search/SourceHandler/ElasticSearch.php:721
Generated By: bluejeep2088, Yesterday at 2:12 AM
Stack Trace
#0 /blah/library/XenES/Search/SourceHandler/ElasticSearch.php(200): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(false, true)
#1 /blah/library/XenForo/Search/SourceHandler/Abstract.php(115): XenES_Search_SourceHandler_ElasticSearch->executeSearch('bronco', false, Array, Array, false, '1000')
#2 /blah/library/XenForo/Search/Searcher.php(79): XenForo_Search_SourceHandler_Abstract->searchGeneral('bronco', Array, 'date', '1000')
#3 /blah/library/XenForo/ControllerPublic/Search.php(230): XenForo_Search_Searcher->searchGeneral('bronco', Array, 'date')
#4 /blah/library/XenForo/FrontController.php(310): XenForo_ControllerPublic_Search->actionSearch()
#5 /blah/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /blah/index.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
  ["url"] => string(50) "http://www.nc4x4.com/forum/index.php?search/search"
  ["_GET"] => array(1) {
    ["search/search"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["keywords"] => string(6) "bronco"
    ["users"] => string(0) ""
    ["date"] => string(0) ""
    ["_xfToken"] => string(56) "3581,1330499539,cd10d9fb844a29ef77f759fbb840069cc92868ae"
  }
}
 

shawn

Well-known member
#12
I added the cron to run every other minute. Forgot to send its output to null for the first couple of hours. :lol:

Problem is, now I'm getting 10-20 of the Elasticsearch server returned no response errors per day.
 

shawn

Well-known member
#14
Nope. I changed the cron to run an actual query. Set it to run every 120s. Had two errors in the last ~35mins.

Hmm...

[edit]: Trying something slightly different. I'll keep you posted.
 

shawn

Well-known member
#15
Ok... definitely no better:

Code:
Elasticsearch server returned no response. Is it running?  Today at 5:42 PM - library/XenES/Search/SourceHandler/ElasticSearch.php:721

Elasticsearch server returned no response. Is it running?  Today at 5:41 PM - library/XenES/Search/SourceHandler/ElasticSearch.php:721

Elasticsearch server returned no response. Is it running?  Today at 3:15 PM - library/XenES/Search/SourceHandler/ElasticSearch.php:721
 

shawn

Well-known member
#17
If I run a query like that from the command line, I get the following response:

{"error":"IndexMissingException[[cluster_1] missing]","status":404}
Also, I'm finding that most searches die the first time they're ran. If you run them again immediately afterward, they go through just fine.

I'm finding that the elasticsearch 'manual' is contradictory. A lot of it is out of date. None of it is particularly in-depth. For example, older pages talk about setting memory limits the way that Slavik described in his write-up. Newer manual pages say *not* to do it this way. The latest stable build (0.19) doesn't even include the elasticsearch.conf file where these variables were defined.
 

shawn

Well-known member
#18
Also getting this error now when I try to reindex:

Undefined variable: indexName
  1. XenForo_Application::handlePhpError() in XenES/Search/SourceHandler/ElasticSearch.php at line 50
  2. XenES_Search_SourceHandler_ElasticSearch->insertIntoIndex() in XenForo/Search/Indexer.php at line 44
  3. XenForo_Search_Indexer->insertIntoIndex() in XenForo/Search/DataHandler/Post.php at line 51
  4. XenForo_Search_DataHandler_Post->_insertIntoIndex() in XenForo/Search/DataHandler/Abstract.php at line 227
  5. XenForo_Search_DataHandler_Abstract->insertIntoIndex() in XenForo/Search/DataHandler/Post.php at line 123
  6. XenForo_Search_DataHandler_Post->quickIndex() in XenForo/Search/DataHandler/Post.php at line 93
  7. XenForo_Search_DataHandler_Post->rebuildIndex() in XenForo/CacheRebuilder/SearchIndex.php at line 91
  8. XenForo_CacheRebuilder_SearchIndex->rebuild() in XenForo/ControllerHelper/CacheRebuild.php at line 26
  9. XenForo_ControllerHelper_CacheRebuild->rebuildCache() in XenForo/ControllerAdmin/Tools.php at line 78
  10. XenForo_ControllerAdmin_Tools->actionCacheRebuild() in XenForo/FrontController.php at line 310
  11. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  12. XenForo_FrontController->run() in /websites/nc4x4/forum/admin.php at line 13
I have to manually delete the index directory from the command line first.
 

Mike

XenForo developer
Staff member
#19
I've increased a timeout variable related to ES, though it was set to 10 seconds before which should be plenty. (It's 20 seconds now.)

You may want to look at changing your memory configuration options for ES if it's happening consistently.
 

Slavik

XenForo moderator
Staff member
#20
I've increased a timeout variable related to ES, though it was set to 10 seconds before which should be plenty. (It's 20 seconds now.)

You may want to look at changing your memory configuration options for ES if it's happening consistently.

Hey Mike,

The times i've been able to generate the error it comes back after 4-5 seconds with no result, definately not as high as 10 seconds for me at least, and the memory settings I have configured should most definately not be an issue (Es has 4gb available to it)