https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42174
Bug ID: 42174
Summary: Elasticsearch throws "Too many clauses" error
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P5 - low
Component: Searching - Elasticsearch
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
In ES8 or ES9 in KTD if you search with a lot of terms like:
is this too many search terms to search a a single time maybe
you get in the logs:
[http://es:9200]-[400] [illegal_argument_exception] Query rewrite failed: too
many clauses, called from sub
Search::Elasticsearch::Role::Cxn::process_response at
/kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 56. With vars:
{'status_code' => 400,'body' => {'status' => 400,'error' => {'type' =>
'search_phase_execution_exception','failed_shards' => [{'reason' => {'reason'
=> 'Query rewrite failed: too many clauses','type' =>
'illegal_argument_exception','caused_by' => {'reason' => 'Query contains too
many nested clauses; maxClauseCount is set to 1024','type' =>
'too_many_nested_clauses'}},'index' => 'koha_kohadev_biblios','node' =>
'o6de3CLcQfmF5HA5oW8QsQ','shard' => 0}],'root_cause' => [{'type' =>
'illegal_argument_exception','reason' => 'Query rewrite failed: too many
clauses'}],'reason' => 'all shards failed','caused_by' => {'caused_by' =>
{'type' => 'illegal_argument_exception','reason' => 'Query rewrite failed: too
many clauses','caused_by' => {'reason' => 'Query contains too many nested
clauses; maxClauseCount is set to 1024','type' =>
'too_many_nested_clauses'}},'reason' => 'Query rewrite failed: too many
clauses','type' => 'illegal_argument_exception'},'grouped' => bless( do{\(my $o
= 1)}, 'JSON::PP::Boolean' ),'phase' => 'query'}},'request' => {'method' =>
'GET','ignore' => [],'serialize' => 'std','body' => {'query' => {'bool' =>
{'must' => [{'query_string' => {'lenient' => bless( do{\(my $o = 1)},
'JSON::PP::Boolean' ),'query' => '(is* this* too* many* search* terms* to*
search* a* a* single* time* maybe*)','fuzziness' => 'auto','analyze_wildcard'
=>
$VAR1->{'request'}{'body'}{'query'}{'bool'}{'must'}[0]{'query_string'}{'lenient'},'type'
=> 'cross_fields','default_operator' => 'AND','fields' =>
['music-key','number-local-acquisition','title-collective','date-entered-on-file','ln-audio','stack','author','lf','author-name-corporate','rtype','cn-bib-source','local-number','title-former','datelastseen','name-geographic','datelastborrowed','control-number-identifier','cn-sort','issues','identifier-other','date-time-last-modified','host-item','number-db','materials-specified','biblioitemnumber','issn-all','coden','price','lc-card-number','totalissues','publisher','author-title','geolocation_lon','identifier-publisher-for-music','personal-name','bgf-number','language-original','issn','cn-suffix','lost','author-personal-bibliography','title-other-variant','reserves','musical-presentation','title-expanded','ln','subject-name-personal','uri','ff7-01-02','itemtype','restricted','editor','ff8-29','barcode','itype','llength','lc-call-number','author-in-order','geolocation_lat','material-type','microform-generation','title-uniform','bnb-card-number','record-control-number','nal-call-number','stock-number','curriculum','coded-location-qualifier','code-geographic','identifier-standard','author-name-personal','title-cover','name','code-institution','number-govt-pub','renewals','interest-age-level','homebranch','cross-reference','damaged','acqsource','interest-grade-level','index-term-uncontrolled','ff7-01','extent','index-term-genre','thematic-number','ln-subtitle','itemnumber','bib-level','isbn','copynumber','not-onloan-count','date-of-acquisition','koha-auth-number','title-series','arp','title-later','nlm-call-number','copydate','current-publication-frequency','date-of-publication','classification-source','ctype','title-no-punctuation','name-and-title','map-scale','number-legal-deposit','cn-bib-sort','bio','number-natl-biblio','cn-prefix','withdrawn','related-periodical','dewey-classification','cn-class','ta','holdingbranch','record-source','ff8-23','abstract','ff7-00','cn-item','title','replacementprice','local-classification','corporate-name','report-number','dissertation-information','note','location','other-control-number','control-number','udc-classification','reading-grade-level','notforloan','ccode','su-geo','indexed-by','host-item-number','replacementpricedate','subject','title-key','title-abbreviated','arl','geographic-class','provider','pl','isbn-all','lexile-number','conference-name','ff7-02']}}],'should'
=> [{'match' => {'title-cover' => {'query' => 'is this too many search terms to
search a a single time maybe'}}}]}},'size' => '20','aggregations' => {'itype'
=> {'terms' => {'field' => 'itype__facet','size' => '20'}},'homebranch' =>
{'terms' => {'field' => 'homebranch__facet','size' => '20'}},'location' =>
{'terms' => {'field' => 'location__facet','size' => '20'}},'su-geo' => {'terms'
=> {'size' => '20','field' => 'su-geo__facet'}},'ccode' => {'terms' => {'size'
=> '20','field' => 'ccode__facet'}},'author' => {'terms' => {'size' =>
'20','field' => 'author__facet'}},'title-series' => {'terms' => {'size' =>
'20','field' => 'title-series__facet'}},'holdingbranch' => {'terms' => {'size'
=> '20','field' => 'holdingbranch__facet'}},'ln' => {'terms' => {'size' =>
'20','field' => 'ln__facet'}},'subject' => {'terms' => {'size' => '20','field'
=> 'subject__facet'}}},'sort' => [{'_score' => {'order' =>
'desc'}},{'local-number' => {'order' => 'desc'}}],'from' => 0},'qs' =>
{'track_total_hits' => 'true'},'path' =>
'/koha_kohadev_biblios/_search','mime_type' => 'application/json'}}
Checking ES documentation it seems both the way clauses are calculated and the
limit have changed
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/