<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          WuKong Search全文搜索引擎

          聯(lián)合創(chuàng)作 · 2023-09-29 03:39

          WuKong 全文搜索引擎。功能特性:

          示例代碼:

          package main
          
          import (
              "github.com/huichen/wukong/engine"
              "github.com/huichen/wukong/types"
              "log"
          )
          
          var (
              // searcher是協(xié)程安全的
              searcher = engine.Engine{}
          )
          
          func main() {
              // 初始化
              searcher.Init(types.EngineInitOptions{
                  SegmenterDictionaries: "github.com/huichen/wukong/data/dictionary.txt"})
              defer searcher.Close()
          
              // 將文檔加入索引
              searcher.IndexDocument(0, types.DocumentIndexData{Content: "此次百度收購將成中國互聯(lián)網(wǎng)最大并購"})
              searcher.IndexDocument(1, types.DocumentIndexData{Content: "百度宣布擬全資收購91無線業(yè)務(wù)"})
              searcher.IndexDocument(2, types.DocumentIndexData{Content: "百度是中國最大的搜索引擎"})
          
              // 等待索引刷新完畢
              searcher.FlushIndex()
          
              // 搜索輸出格式見types.SearchResponse結(jié)構(gòu)體
              log.Print(searcher.Search(types.SearchRequest{Text:"百度中國"}))
          }
          瀏覽 21
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲美女日逼 | 高潮喷水网站 | 色逼| 老外玩csgo中国的妹子视频 | 麻豆久久久久久久 |