[Php] 304 $ sphinxapi-& gt; SetSelect (& amp; #39; id, domain_hash & amp; #39;); 304 $ sphinxapi-& gt; setConnectTimeout (3); 305 $ sphinxapi-& gt; SetGroupBy (& amp; #39; domain_hash &
[Php]
304 $ sphinxapi-> SetSelect ('Id, domain_hash ');
304 $ sphinxapi-> SetConnectTimeout (3 );
305 $ sphinxapi-> SetGroupBy ('domain _ hash', SPH_GROUPBY_ATTR, '@ count desc ');
304 foreach ($ result ['matches'] AS $ k => $ v)
321 {
322 $ IDARRAY [$ v ['attrs'] ['domain _ hash'] = $ v ['attrs'] ['@ count'];
323 $ total + = $ v ['attrs'] ['@ count'];
324}
$ SQL = "SELECT site_name FROM ** WHERE domain_hash IN (". join (',', array_keys ($ IDARRAY )). ") order by find_in_set (domain_hash ,'". join (',', array_keys ($ IDARRAY )). "')";
331 $ rawDataAll = Yii: app ()-> db-> createCommand ($ SQL)-> queryAll ();
304 $ sphinxapi-> SetSelect ('Id, domain_hash ');
304 $ sphinxapi-> SetConnectTimeout (3 );
305 $ sphinxapi-> SetGroupBy ('domain _ hash', SPH_GROUPBY_ATTR, '@ count desc ');
304 foreach ($ result ['matches'] AS $ k => $ v)
321 {
322 $ IDARRAY [$ v ['attrs'] ['domain _ hash'] = $ v ['attrs'] ['@ count'];
323 $ total + = $ v ['attrs'] ['@ count'];
324}
$ SQL = "SELECT site_name FROM ** WHERE domain_hash IN (". join (',', array_keys ($ IDARRAY )). ") order by find_in_set (domain_hash ,'". join (',', array_keys ($ IDARRAY )). "')";
331 $ rawDataAll = Yii: app ()-> db-> createCommand ($ SQL)-> queryAll ();
Generally, the hash values are 12024309506718423877,64-bit. The int type cannot meet the requirements,
[$ V ['attrs'] ['domain _ hash'] is actually truncated lossy data ......
SQL _attr_unit = domain_hash
11.1.17. SQL _attr_uint: integer attribute
Declare the unsigned integer attribute ). You can declare multiple attributes with different names of the same type. optional. Only applicable to SQL data sources (mysql, pgsql, and mssql ).
The declared column value must be within a 32-bit unsigned integer value range. Values that exceed this range are also accepted, but will overflow. For example,-1 will change to 2 ^ 32-1 or 4,294,967,295.
You can append ": BITCOUNT" (see the following example) to specify the number of digits of the integer property. If the attribute is smaller than the default 32-bit (this is called a bit field), the performance will be compromised. However, they can save memory in the extern storage mode: These bit fields are combined into 32-bit block storage in the. spa attribute data file. If inline storage is used, the bit width setting is ignored.
The hash field must be of the bigint type in the conf configuration.
SQL _attr_bigint = domain_hash
11.1.19. SQL _attr_bigint: long integer property
Attribute declaration. Multiple values (multiple attributes can be declared at the same time). optional. Only applicable to SQL data sources (mysql, pgsql, and mssql ). Note that, unlike SQL _attr_uint, these values are signed. Introduced in version 0.9.9-rc1.