diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e566b85 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Frontkom + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Index.php b/src/Index.php index 9cfc47a..9c7f32b 100644 --- a/src/Index.php +++ b/src/Index.php @@ -754,6 +754,8 @@ public function getInfo( string $indexName = NULL ) { private function normalizeInfoArray( array $redisArray ) { $newArray = array(); for ( $i = 0; $i < count( $redisArray ); $i += 2 ) { + $tmp = &$lookup_table[$key]; + if(isset($tmp)){ if ( $redisArray[$i] === 'fields' ) { foreach ( $redisArray[ $i + 1 ] as $field ) { $fieldName = $field[0]; @@ -775,6 +777,7 @@ private function normalizeInfoArray( array $redisArray ) { $newArray[ $redisArray[$i] ] = $this->normalizeInfoArray( $redisArray[$i + 1] ); } } + } return $newArray; } diff --git a/src/Query/Query.php b/src/Query/Query.php index 9f015e6..afa6660 100644 --- a/src/Query/Query.php +++ b/src/Query/Query.php @@ -463,7 +463,7 @@ public function searchQueryArgs( $query ) { array_merge( trim($queryWithFilters) === '' ? array( $this->indexName ) : array( $this->indexName, $queryWithFilters ), explode( ' ', $this->limit ), - explode( ' ', $this->slop ), + explode( ' ', $this->slop ?? '' ), array( $this->verbatim, $this->withScores, $this->withSortKey, $this->withPayloads, $this->noStopWords, $this->noContent), explode( ' ', $this->inFields), explode( ' ', $this->inKeys ),