All in One

參數

參數名稱 說明
facet

是否回傳 facet。

預設為 0: 不回傳 facet。

若設為 1 則會回傳四種 facet: 部類、作譯者、朝代、典籍。

rows 每頁回傳卷數,預設為 20。
start 每頁起始位置,預設為 0。
around kwic 前後字數,預設為 10。
order

排序,可用欄位:

  • work (依典籍編號排序)
  • time_from (依起始時間)
  • time_to (依結束時間)

預設是依 term_hits (一卷之中出現關鍵字的次數) 來排序。

每一個排序欄位都可以指定使用升冪排序或降冪排序:

  • 指定升冪排序:order=time_from+
  • 指定降冪排序:order=time_from-

不回傳 facet 範例:

{
  "query_string": "法鼓",
  "SQL": "SELECT id, juan, canon, vol, work, byline, weight() as term_hits FROM cbeta WHERE MATCH('\"法鼓\"') LIMIT 0, 20 OPTION ranker=wordcount,max_matches=9999999",
  "time": 0.272479,
  "num_found": 1059,
  "total_term_hits": 1492,
  "results": [
    {
      "juan": 1,
      "canon": "T",
      "vol": "T09",
      "work": "T0270",
      "byline": "劉宋 求那跋陀羅譯",
      "term_hits": 31,
      "title": "大法鼓經",
      "juan_list": "1,2",
      "file": "T09n0270",
      "juan_start": 1,
      "kwics": {
        "num_found": 31,
        "results": [
          {
            "lb": "0292a22",
            "kwic": ";法王祇洹林,擊於大<mark>法鼓</mark>。」佛告迦葉:「汝今"
          },
          {
            "lb": "0291c14",
            "kwic": "世尊說大法鼓經、擊大<mark>法鼓</mark>、吹大法䗍。」佛言:"
          },...
        ]
      }
    },
    {
      "juan": 2,
      "canon": "T",
      "vol": "T09",
      "work": "T0270",
      "byline": "劉宋 求那跋陀羅譯",
      "term_hits": 15,
      "title": "大法鼓經",
      "juan_list": "1,2",
      "file": "T09n0270",
      "juan_start": 1,
      "kwics": {
        "num_found": 15,
        "results": [
          {
            "lb": "0298c21",
            "kwic": "護持如今正法,當擊大<mark>法鼓</mark>、吹大法䗍、設大法會"
          },
          {
            "lb": "0299a10",
            "kwic": "——於我滅後,當擊大<mark>法鼓</mark>、吹大法䗍、設大法會"
          },...
        ]
      }
    },...
  ]
}

回傳 facet 範例:

{
  "query_string": "法鼓",
  ...
  "results": [...],
  "facet": {
    "category": [
      {
        "category_id": 17,
        "juans": 283,
        "category_name": "禪宗部類"
      },
      {
        "category_id": 23,
        "juans": 151,
        "category_name": "新編部類"
      }...
    ],
    "creator": [
      {
        "creator_id": "A001519",
        "juans": 23
      },
      {
        "creator_id": "A001755",
        "juans": 21
      }...
    ],
    "dynasty": [
      {
        "dynasty": "清",
        "juans": 216
      },
      {
        "dynasty": "唐",
        "juans": 164
      }...
    ],
    "work": [
      {
        "work": "B0088",
        "title": "古今圖書集成選輯(上)",
        "juans": 32
      },
      {
        "work": "B0192",
        "title": "釋文紀",
        "juans": 17
      },...
    ]
  }
}