zoukankan      html  css  js  c++  java
  • 对MariaDB10.0的Sphinx进行扩展

    已修改过的文件:http://pan.baidu.com/s/1o8DHvkA

    将这两个文件放到MariaDB的解压目录后,再进行安装

    /usr/local/mariadb-10.0.28/storage/sphinx/

    如下是修改的代码

    get_rec ( byte * buf, const byte * key, uint keylen,uint a,uint b,uint c );
    
    index_next_same ( byte * buf, const byte * key, uint keylen,uint a,uint b,uint c );
    
    SPHINXSE_SYSTEM_COLUMNS 6
    
    SPH_RET ( get_rec ( buf, key, key_len ,pTable->m_tStats.m_iMatchesTotal,pTable->m_tStats.m_iMatchesFound,pTable->m_tStats.m_iQueryMsec ) );
    
    field[3]->store ( a, 1 );
    field[4]->store ( b, 1 );
    field[5]->store ( b, 1 );
    
    SPH_RET ( get_rec ( buf, m_pCurrentKey, m_iCurrentKeyLen,m_a,m_b,m_c ) );
    
    int ha_sphinx::index_next_same ( byte * buf, const byte * key, uint keylen,uint a,uint b,uint c )
    {
            SPH_ENTER_METHOD();
            SPH_RET ( get_rec ( buf, key, keylen,a,b,c ) );
    }
    
    int ha_sphinx::get_rec ( byte * buf, const byte *, uint ,uint a,uint b,uint c)
    
    uint                    m_a;
    uint                    m_b;
    uint                    m_c;
    
    , m_a ( 0 )
    , m_b ( 0 )
    , m_c ( 0 )
    CREATE TABLE `table_sphinxse` (
      `id` bigint(20) unsigned NOT NULL,
      `weight` int(11) DEFAULT '1',
      `query` varchar(20480) NOT NULL,
      `Matchestotal` int(11) DEFAULT '0',
      `Matchesfound` int(11) DEFAULT '0',
      `Querymsec` int(11) DEFAULT '0',
      `Fadd_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
      KEY `query` (`query`(1024))
    ) ENGINE=SPHINX DEFAULT CHARSET=utf8 CONNECTION='sphinx://127.0.0.1:4312';
    select sql_no_cache id,matchesfound from table_sphinxse where query='filter=res_type,1';

    共多少条

  • 相关阅读:
    百度之星 1211 题目一
    acdream 1019 Palindrome 字符串hash
    POJ2480 Longge's problem 欧拉函数
    C#为应用程序注册快捷键
    sql跨数据库查询
    嵌入式轻量级数据库 SQLite和 System.Data.SQLite
    经典问题 C#隐藏和显示窗体
    System.Data.SQLite类Dll下载地址和移植C# SQLite
    CMMI5
    两个ComboBox之间Item的移动
  • 原文地址:https://www.cnblogs.com/kgdxpr/p/6593842.html
Copyright © 2011-2022 走看看