https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25051 Bug ID: 25051 Summary: Elasticsearch truncates range searches when QueryAutoTruncate is enabled Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com To test: 1 - Enable QueryAutoTruncate 2 - Try a search like: copydate:[1990 TO 2010] 3 - Esplosions! Or at least, the search fails with error log like: [Request] ** [http://es:9200]-[400] [query_shard_exception] Failed to parse query [(copydate:[1990* TO* 2010])], with: {"index_uuid":"lYb_5AVrT7iyEgLK-TGewg","index":"koha_kohadev_biblios"}, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 100. With vars: {'request' => {'path' => '/koha_kohadev_biblios/_search','mime_type' => 'application/json','serialize' => 'std','ignore' => [],'body' => {'query' => {'query_string' => {'fields' => ['cn-bib-source','number-legal-deposit','number-db','other-control-number','stock-number','ff7-00','cn-prefix','cn-class','local-classification','report-number','language-original','notforloan','number-natl-biblio','materials-specified','barcode','totalissues','arp','related-title','bio','index-term-genre','ff8-23','date-of-acquisition','number-govt-pub','title-series','identifier-publisher-for-music','pl','copydate','ctype','title-abbreviated','su-geo','host-item-number','author-in-order','ff7-02','title-uniform','identifier-other','cn-sort','ln-subtitle','author-name-corporate','personal-name','nlm-call-number','material-type','ccode','coden','name-geographic','itype','arl','restricted','copynumber','reading-grade-level','host-item','replacementprice','title-later','subject','isbn','title','title-other-variant','title-collective','stack','code-institution','name-and-title','ff8-29','corporate-name','cn-bib-sort','location','number-local-acquisition','homebranch','coded-location-qualifier','nal-call-number','ln-audio','author-name-personal','control-number','record-source','date-time-last-modified','extent','acqsource','bgf-number','related-periodical','interest-grade-level','interest-age-level','koha-auth-number','date-entered-on-file','holdingbranch','lc-card-number','curriculum','note','map-scale','author-personal-bibliography','abstract','bib-level','identifier-standard','ln','name','subject-name-personal','lost','withdrawn','itemtype','ta','editor','dewey-classification','uri','music-key','price','biblioitemnumber','itemnumber','provider','local-note','indexed-by','rtype','title-former','code-geographic','issues','classification-source','lc-call-number','replacementpricedate','record-control-number','cn-suffix','cross-reference','publisher','title-expanded','ff7-01','author','conference-name','contents','index-term-uncontrolled','datelastborrowed','thematic-number','local-number','datelastseen','reserves','not-onloan-count','title-key','title-cover','bnb-card-number','udc-classification','renewals','ff7-01-02','date-of-publication','lf','cn-item','dissertation-information','geographic-class','issn','damaged','author-title','lexile-number','llength','microform-generation'],'default_operator' => 'AND','query' => '(copydate:[1990* TO* 2010])','fuzziness' => 'auto','lenient' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ),'analyze_wildcard' => $VAR1->{'request'}{'body'}{'query'}{'query_string'}{'lenient'}}},'size' => '20','from' => 0,'aggregations' => {'su-geo' => {'terms' => {'size' => '20','field' => 'su-geo__facet'}},'author' => {'terms' => {'field' => 'author__facet','size' => '20'}},'location' => {'terms' => {'field' => 'location__facet','size' => '20'}},'title-series' => {'terms' => {'size' => '20','field' => 'title-series__facet'}},'itype' => {'terms' => {'field' => 'itype__facet','size' => '20'}},'ccode' => {'terms' => {'field' => 'ccode__facet','size' => '20'}},'ln' => {'terms' => {'size' => '20','field' => 'ln__facet'}},'holdingbranch' => {'terms' => {'field' => 'holdingbranch__facet'}},'subject' => {'terms' => {'size' => '20','field' => 'subject__facet'}}}},'qs' => {},'method' => 'GET'},'body' => {'status' => 400,'error' => {'failed_shards' => [{'index' => 'koha_kohadev_biblios','reason' => {'index' => 'koha_kohadev_biblios','reason' => 'Failed to parse query [(copydate:[1990* TO* 2010])]','caused_by' => {'type' => 'parse_exception','reason' => 'Cannot parse \'(copydate:[1990* TO* 2010])\': Encountered " <RANGE_GOOP> "TO* "" at line 1, column 17. Was expecting: "TO" ... ','caused_by' => {'reason' => 'Encountered " <RANGE_GOOP> "TO* "" at line 1, column 17. Was expecting: "TO" ... ','type' => 'parse_exception'}},'type' => 'query_shard_exception','index_uuid' => 'lYb_5AVrT7iyEgLK-TGewg'},'shard' => 0,'node' => '-yc8mDy8SDu6U12yEpvXFA'}],'phase' => 'query','type' => 'search_phase_execution_exception','grouped' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ),'reason' => 'all shards failed','root_cause' => [{'index_uuid' => 'lYb_5AVrT7iyEgLK-TGewg','type' => 'query_shard_exception','reason' => 'Failed to parse query [(copydate:[1990* TO* 2010])]','index' => 'koha_kohadev_biblios'}]}},'status_code' => 400} Use of uninitialized value $error in concatenation (.) or string at /kohadevbox/koha/catalogue/search.pl line 558. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.