跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[奇思妙想] 通用搜索语言

发表于

知乎答“现在业界是否需要新的编程语言?如果需要,那需要什么类型的编程语言?”

从技术角度看是个很小的领域,但其应用极广,是几乎每个在线用户每天都用到的功能。

信息有各种组织方式,但都需要‘搜索’这一人机界面。应用包括本地文件文本搜索、网页搜索、数据库搜索等。

各应用举例

网页搜索

谷歌高级搜索 的 Operators 为例,除了最基本的:

关键词 "某特定短语" site:某网站 -排除词

还有 几十个其他的,如 OR/AND/*/filetype/before/after 。

针对网络资源,功能包含:

  • 包含或排除某(些)词或短语
  • 指定发布时间范围
  • 指定文件格式
  • 路径( url )包含某内容

文本搜索

此文 用作基准的 grep 为例。

grep -r --include="某文件名模式" "文本模式" 路径

针对文本文件,功能包含:

  • 通过模式匹配,可包含或排除某(些)词或短语
  • 指定文件时间戳范围,借助 find
  • 指定文件范围,如路径、文件名模式等

数据库

以 SQL 为例,针对按表格存储的记录,功能包含:

SELECT 某列
FROM 某表
WHERE 某列 REGEXP ‘某模式‘ and DATE BETWEEN 开始 and 结束; 
  • 指定记录所在表
  • 通过模式匹配,可包含或排除某(些)词或短语
  • 指定时间戳范围

通用搜索语言

各应用的搜索功能中,虽搜索语法设计不同,有相当一块常用部分重叠。可从这部分需求出发作些风格一致、易读易写的设计尝试。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.