Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -78,6 +78,11 @@ class _Query extends \IPS\Content\Search\Query
|
||||
* @see filterByUnread()
|
||||
*/
|
||||
protected $filterByUnread = FALSE;
|
||||
|
||||
/**
|
||||
* @brief InnoDb Stop words
|
||||
*/
|
||||
protected static $innoDBStopWords = array( 'a','about','an','are','as','at','be','by','com','de','en','for','from','how','i','in','is','it','la','of','on','or','that','the','this','to','was','what','when','where','who','will','with','und','the','www' );
|
||||
|
||||
/**
|
||||
* Filter by multiple content types
|
||||
@@ -692,7 +697,7 @@ class _Query extends \IPS\Content\Search\Query
|
||||
{
|
||||
/* Avoid packet issues */
|
||||
krsort( $markers );
|
||||
$useIds = array_flip( \array_slice( $markers, 0, 500, TRUE ) );
|
||||
$useIds = array_flip( \array_slice( $markers, 0, 1000, TRUE ) );
|
||||
$select = '';
|
||||
$from = '';
|
||||
$notIn = array();
|
||||
@@ -1096,7 +1101,8 @@ class _Query extends \IPS\Content\Search\Query
|
||||
/* Operators are not allowed */
|
||||
$word = preg_replace( '/[+\-><\(\)~*\"@%]+/', '', $word );
|
||||
|
||||
if ( $word )
|
||||
/* If any words are stop words the lookup will fail */
|
||||
if ( $word and !\in_array( $word, static::$innoDBStopWords ) )
|
||||
{
|
||||
$words[] = $word;
|
||||
}
|
||||
@@ -1250,10 +1256,15 @@ class _Query extends \IPS\Content\Search\Query
|
||||
$order = $this->order;
|
||||
|
||||
/* This forces MySQL to strongly hint a better index to the optimiser for MySQL 5.7+, even though sorting will not be affected */
|
||||
if ( $this->filterByUnread and ( ! mb_stristr( \IPS\Db::i()->server_info, '-MariaDB' ) and \IPS\Db::i()->server_version >= 50700 ) )
|
||||
if ( $this->filterByUnread !== FALSE and ( ! mb_stristr( \IPS\Db::i()->server_info, '-MariaDB' ) and \IPS\Db::i()->server_version >= 50700 ) )
|
||||
{
|
||||
$order .= ", index_date_updated";
|
||||
}
|
||||
|
||||
if( $this->filterByUnread === TRUE )
|
||||
{
|
||||
$this->forceIndex = 'index_date_updated';
|
||||
}
|
||||
|
||||
/* But we're sorting by relevancy, we need to actually select that value with our fancy algorithm */
|
||||
if ( mb_substr( $this->order, 0, 9 ) === 'calcscore' )
|
||||
@@ -1452,4 +1463,4 @@ class _Query extends \IPS\Content\Search\Query
|
||||
/* And then pass up */
|
||||
return parent::termAsWordsArray( $term, $ignorePhrase, $minLength, $maxLength );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user