<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>

          liqe類似 Lucene 的解析器和搜索引擎

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

          liqe 是一個(gè)輕量級和高性能的類似 Lucene 的解析器和搜索引擎。

          Usage

          import {
            filter,
            highlight,
            parse,
            test,
          } from 'liqe';
          
          const persons = [
            {
              height: 180,
              name: 'John Morton',
            },
            {
              height: 175,
              name: 'David Barker',
            },
            {
              height: 170,
              name: 'Thomas Castro',
            },
          ];

          過濾集合:

          filter(parse('height:>170'), persons);
          // [
          //   {
          //     height: 180,
          //     name: 'John Morton',
          //   },
          //   {
          //     height: 175,
          //     name: 'David Barker',
          //   },
          // ]

          測試單個(gè)對象:

          test(parse('name:John'), persons[0]);
          // true
          test(parse('name:David'), persons[0]);
          // false

          突出顯示匹配的字段和子字符串:

          test(highlight('name:john'), persons[0]);
          // [
          //   {
          //     keyword: 'John',
          //     path: 'name',
          //   }
          // ]
          test(highlight('height:180'), persons[0]);
          // [
          //   {
          //     path: 'height',
          //   }
          // ] 
          瀏覽 22
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

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

          手機(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>
                  亚洲视频黄 | 学生妹一级毛片 | 豆花视频理论在线播放 | 中日韩无码视频 | 天天天天色|