@@ -1639,6 +1639,17 @@ function parse(query, options) {
16391639 _ref3$auto = _ref3 . auto ,
16401640 auto = _ref3$auto === void 0 ? true : _ref3$auto ;
16411641 var next = function next ( query ) {
1642+ // Keyless string entry: search across all keys
1643+ if ( isString ( query ) ) {
1644+ var obj = {
1645+ keyId : null ,
1646+ pattern : query
1647+ } ;
1648+ if ( auto ) {
1649+ obj . searcher = createSearcher ( query , options ) ;
1650+ }
1651+ return obj ;
1652+ }
16421653 var keys = Object . keys ( query ) ;
16431654 var isQueryPath = isPath ( query ) ;
16441655 if ( ! isQueryPath && keys . length > 1 && ! isExpression ( query ) ) {
@@ -1650,14 +1661,14 @@ function parse(query, options) {
16501661 if ( ! isString ( pattern ) ) {
16511662 throw new Error ( LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY ( key ) ) ;
16521663 }
1653- var obj = {
1664+ var _obj = {
16541665 keyId : createKeyId ( key ) ,
16551666 pattern : pattern
16561667 } ;
16571668 if ( auto ) {
1658- obj . searcher = createSearcher ( pattern , options ) ;
1669+ _obj . searcher = createSearcher ( pattern , options ) ;
16591670 }
1660- return obj ;
1671+ return _obj ;
16611672 }
16621673 var node = {
16631674 children : [ ] ,
@@ -2027,11 +2038,25 @@ var Fuse = /*#__PURE__*/function () {
20272038 if ( ! node . children ) {
20282039 var keyId = node . keyId ,
20292040 searcher = node . searcher ;
2030- var matches = _this . _findMatches ( {
2031- key : _this . _keyStore . get ( keyId ) ,
2032- value : _this . _myIndex . getValueForItemAtKeyId ( item , keyId ) ,
2033- searcher : searcher
2034- } ) ;
2041+ var matches ;
2042+ if ( keyId === null ) {
2043+ // Keyless entry: search across all keys
2044+ matches = [ ] ;
2045+ _this . _myIndex . keys . forEach ( function ( key , keyIndex ) {
2046+ var _matches ;
2047+ ( _matches = matches ) . push . apply ( _matches , _toConsumableArray ( _this . _findMatches ( {
2048+ key : key ,
2049+ value : item [ keyIndex ] ,
2050+ searcher : searcher
2051+ } ) ) ) ;
2052+ } ) ;
2053+ } else {
2054+ matches = _this . _findMatches ( {
2055+ key : _this . _keyStore . get ( keyId ) ,
2056+ value : _this . _myIndex . getValueForItemAtKeyId ( item , keyId ) ,
2057+ searcher : searcher
2058+ } ) ;
2059+ }
20352060 if ( matches && matches . length ) {
20362061 return [ {
20372062 idx : idx ,
@@ -2072,9 +2097,9 @@ var Fuse = /*#__PURE__*/function () {
20722097 results . push ( resultMap . get ( idx ) ) ;
20732098 }
20742099 expResults . forEach ( function ( _ref5 ) {
2075- var _matches ;
2100+ var _matches2 ;
20762101 var matches = _ref5 . matches ;
2077- ( _matches = resultMap . get ( idx ) . matches ) . push . apply ( _matches , _toConsumableArray ( matches ) ) ;
2102+ ( _matches2 = resultMap . get ( idx ) . matches ) . push . apply ( _matches2 , _toConsumableArray ( matches ) ) ;
20782103 } ) ;
20792104 }
20802105 }
0 commit comments