Configure bigint in Coreseek for hash

Source: Internet
Author: User
[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.


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.