搜尋套件、儲存庫與 APP 分類

套件詳情v0.6.0

typesense

用於存取 Typesense 搜尋引擎 HTTP API 的 Dart 客戶端程式庫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
7810
喜歡數
61
Pub 分數
130

安裝套件

flutter pub add typesense

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Dart 客戶端程式庫,可透過其 HTTP API 與 Typesense 搜尋引擎實現無縫整合。它提供了一種簡單的方式來執行搜尋作業、管理集合,並在 Android、iOS、Web、macOS、Windows 和 Linux 等多個平台索引文件。專為希望在其 Flutter 應用中實現快速、容錯拼寫錯誤的搜尋功能的開發者設計,該庫抽象了底層 HTTP 互動,同時保持彈性和效能。

適用情境

  • Flutter 應用中的即時搜尋
  • 全文搜尋,支援拼字錯誤容錯
  • 索引和管理文件集合
  • 建構自動補全功能
  • 與現有 Typesense 伺服器整合
  • 在行動和網頁應用中搜尋

主要特色

  • 類型安全的 API 包裝器
  • 跨平台相容性
  • 支援搜尋、索引和架構管理
  • 使用 Flutter pub 輕鬆設定
  • 內建錯誤處理
  • 輕便高效

適合對象

  • 使用 Typesense 的 Flutter 開發人員
  • 需要快速搜尋功能的應用程式
  • 需要跨平台搜尋的項目
  • 整合外部搜尋引擎的開發者
  • 構建以搜尋為重點的使用者介面的團隊

使用建議

  • 需要一個正在運行的 Typesense 伺服器
  • 僅限 HTTP API 功能
  • 不支援離線搜尋
  • 依賴網路連接
  • 手動處理複雜的查詢邏輯
  • 不適合僅本地搜尋需求

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Typesense

pub package github actions status pub likes pub points pub downloads

Dart client library for accessing the HTTP API of Typesense search engine.

Note: This package is still under development. Some existing APIs might change or new APIs might be available in the future.

Installation

Add typesense as a dependency in your pubspec.yaml file.

dependencies:
  typesense: ^0.6.0

Usage

Read the documentation here: https://typesense.org/docs/api/

Tests are also a good place to know how the library works internally: test

Note: When using this library in a user-facing app, please be sure to use an API Key that only allows search operations instead of the master API key. See keys.dart for an example of how to generate a search only API key.

See Configuration class for a list of all client configuration options.

Examples
import 'dart:io';

import 'package:typesense/typesense.dart';


void main() async {
  // Replace with your configuration
  final host = InternetAddress.loopbackIPv4.address, protocol = Protocol.http;
  final config = Configuration(
    // Api key
    'xyz',
    nodes: {
      Node(
        protocol,
        host,
        port: 7108,
      ),
      Node.withUri(
        Uri(
          scheme: 'http',
          host: host,
          port: 8108,
        ),
      ),
      Node(
        protocol,
        host,
        port: 9108,
      ),
    },
    numRetries: 3, // A total of 4 tries (1 original try + 3 retries)
    connectionTimeout: const Duration(seconds: 2),
  );

  final client = Client(config);

  final searchParameters = {
    'q': 'stark',
    'query_by': 'company_name',
    'filter_by': 'num_employees:>100',
    'sort_by': 'num_employees:desc'
  };

  await client.collection('companies').documents.search(searchParameters);
}

The examples that walk you through on how to use the client: main.dart

Make sure to README beforehand.

Compatibility

Typesense Server typesense-dart
>= v30.0 >= v0.6.0
>= v0.24.0 >= v0.5.0
>= v0.22.0 >= v0.3.0
>= v0.21.0 >= v0.1.1

Contributing

Visit CONTRIBUTING.md

Credits

This library is authored and maintained by our awesome community of contributors:

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。