protected function clean( $meta = null ) {

    //
    if( $meta && !( $meta instanceof StorageMeta ) ) {
      $meta = $this->getMeta( $meta );
    }

    // clear the cache
    if( !$meta || empty( $meta->token ) ) $this->cache = [];
    else foreach( $this->cache as $i => $_ ) {

      if( empty( $i ) || $i == $meta->token[ 0 ] || strpos( $i, $meta->token[ 0 ] ) === 0 ) {
        unset( $this->cache[ $i ] );
      }
    }
  }
protected function clean( $meta = null ) {

    //
    if( $meta && !( $meta instanceof StorageMeta ) ) {
      $meta = $this->getMeta( $meta );
    }

    // clear the cache
    if( !$meta || empty( $meta->token ) ) $this->cache = [];
    else foreach( $this->cache as $i => $_ ) {

      if( empty( $i ) || $i == $meta->token[ 0 ] || strpos( $i, $meta->token[ 0 ] ) === 0 ) {
        unset( $this->cache[ $i ] );
      }
    }
  }
protected function clean ( $ meta = null ) { // if ( $ meta && ! ( $ meta instanceof StorageMeta ) ) { $ meta = $ this -> getMeta ( $ meta ) ; } // clear the cache if ( ! $ meta || empty ( $ meta -> token ) ) $ this -> cache = [ ] ; else foreach ( $ this -> cache as $ i => $ _ ) { if ( empty ( $ i ) || $ i == $ meta -> token [ 0 ] || strpos ( $ i , $ meta -> token [ 0 ] ) === 0 ) { unset ( $ this -> cache [ $ i ] ) ; } } }
Clean the search cache based on the index

@param string|StorageMeta|null $meta
Clean the search cache based on the index