[url]http://d.hatena.ne.jp/perezvon/20080921/1222016246[/url]

>>> from tokyodystopia import TokyoDystopia
>>> db = TokyoDystopia("/tmp/test.db", 255)
>>> db.put(0, u"仙台".encode("utf8"), " ")
1
>>> db.put(1, u"仙台 広島".encode("utf8"), " ")
1
>>> db.put(2, u"広島 山形 湘南 山形".encode("utf8"), " ")
1
>>> db.search(u"仙台".encode("utf-8"))
2
[0L, 1L]
>>> db.search(u"広島".encode("utf-8"))
2
[1L, 2L]
>> db.close()

The function `tcidbsearch2' searches with a compound expression. In the compound expression, tokens are separated by one or more white space characters. If one token is specified, records including the specified pattern are searched for. Upper or lower case is not distinguished. Accent marks and diacritical marks are ignored. If two or more tokens are specified, records including all of the patterns are searched for. The compound expression includes the following sub expressions.

* A B : searches for records including the two tokens.
* A && B : searches for records including the two tokens.
* A || B : searches for records including the one or both of the two tokens.
* "A B..." : searches for records including the phrase.
* [A] : searches for records including words exactly matching the token.
* [A*] : searches for records including words beginning with the token.
* [*A] : searches for records including words ending with the token.
* [[A : searches for records beginning with the token.
* A]] : searches for records ending with the token.

Note that the priority of "||" is higher than the one of "&&".

Tokyo Dystopia 全文搜索相关推荐

  1. Tokyo Dystopia 1000w数据测试

    Tokyo Dystopia是一个全文搜索引擎,究竟它的性能如何呢?能否用于海量数据搜索呢?我使用了1000w(实际10170524条记录)网站标题来分词,并用于Tokyo Dystopia做本文相关 ...

  2. 命令行的全文搜索工具--ack

    想必大家在命令行环境下工作时候,一定有想要查找当前目录下的源代码文件中的某些字符的需求,这时候如果使用传统方案,你可能需要输入一长串的命令,比如这样: 1. grep -R 'string' dir/ ...

  3. php 全局搜索方法,php启用sphinx全文搜索的方法

    php启用sphinx全文搜索的方法 sql_pass                                = 1 sql_db                               ...

  4. PostgreSQL 10.1 手册_部分 II. SQL 语言_第 12 章 全文搜索_12.9. GIN 和 GiST 索引类型

    12.9. GIN 和 GiST 索引类型 有两种索引可以被用来加速全文搜索.注意全文搜索并非一定需要索引,但是在一个定期会被搜索的列上,通常需要有一个索引. CREATE INDEX name ON ...

  5. 基于ASP.NET的lucene.net全文搜索(一)

    在做项目的时候,需求添加全文搜索,选择了lucene.net方向,调研了一下,基本实现了需求,现在将它分享给大家.理解不深请多多包涵. 在完成需求的时候,查看的大量的资料,本文不介绍详细的lucene ...

  6. SQLite中使用全文搜索FTS

    SQLite中使用全文搜索FTS SQLite支持全文搜索.通过全文搜索功能,可以方便用户快速进行查找.在iOS中,GRDB.FMDB等SQLite框架均支持FTS技术,如FTS3.FTS4等.各个框 ...

  7. 不用CMake编译查询OpenCV函数、类定义等的方法(全文搜索-所有文档搜索指定内容神器:CJC超级硬盘快搜索和AnyTXT Searcher)

    图像处理开发需求.图像处理接私活挣零花钱,请加微信/QQ 2487872782 图像处理开发资料.图像处理技术交流请加QQ群,群号 271891601 大家都知道,OpenCV如果没有CMak的话,程 ...

  8. Flask 教程 第十六章:全文搜索

    本文转载自:https://www.jianshu.com/p/56cfc972d372 这是Flask Mega-Tutorial系列的第十六部分,我将在其中为Microblog添加全文搜索功能. ...

  9. CHM格式的可以全文搜索的Spring3.2官方参考文档

        Spring的官方参考文档是html格式的,并且没有目录树,用它本身的跳转功能,跳来跳去经常把头给跳晕了! 最重要的一个缺点是没有全文搜索,于是一生气就做了一个CHM格式的有目录,带全文搜索的 ...

最新文章

  1. python检查目录是否存在,如果不存在则创建
  2. [PSP]通向5.50-D3的倒数计时
  3. 微软687亿美元收购动视暴雪成第三大游戏公司,网友:米哈游只有收购索尼才能抗衡了...
  4. PHP解决方案@时间戳与时间日期
  5. 使用FastCoder写缓存单例
  6. Google cpp style guide 之 include
  7. C4C权限控制的一些特色功能和测试
  8. 5000元性价比高的笔记本_2018性价比笔记本电脑品牌推荐 5000左右笔记本性价比推荐...
  9. 从零开始学习PYTHON3讲义(二)把Python当做计算器
  10. 作者:洪文兴(1980-),男,厦门大学自动化系副教授,厦门信息产业与信息化研究院执行院长。...
  11. 最详细的 Spring Boot 多模块开发与排坑指南
  12. 分布式定时任务——elastic-job
  13. python3.6.5安装步骤-Centos7 安装Python3.6.5
  14. RESTFULL 03 rest-framework视图
  15. 5、WPF实现简单计算器-非常适合初学者练习
  16. iconfont矢量图标在小程序中的使用
  17. PE文件格式偏移参考
  18. 大话西游2服务器修改,大话西游2:9.17维护解读:五倍次数修改全服上线,灵兽村要变样啦...
  19. python写整数逆位运算_整数逆位运算
  20. 政府采购和招标投标常见问题:评标的依据是什么?

热门文章

  1. 面试感悟----一名3年工作经验的程序员应该具备的技能,对于一些入门或者还在面试阶段的人有着很大的启发...
  2. php函数题,求教:用php函数算题
  3. 如何去除PDF的水印?【9种方法总结】
  4. “2012年全国职业院校技能大赛”高职组信息安全管理与评估赛项获奖名单
  5. 《资讯:元宇宙》(Yanlz+VR云游戏+Unity+SteamVR+云技术+5G+AI+区块链+NFT+绿洲+头号玩家+平行宇宙+虚拟世界+Pico+Oculus+Soul+立钻哥哥++==)
  6. 前端加密方法sha256.js源码+用法(亲测可用)
  7. 《Hadoop Operations》读书笔记 - 4 - 第五章 安装与配置
  8. 编程从键盘输入一个字符串,统计该字符串中从‘a‘到‘z‘共26个小写字母各自出现的次数, 将结果存入数组中,并输出
  9. 实验——MySQL数据库增量备份恢复
  10. sql2000企业版安装