搜索插件、代码仓与 APP 分类

插件详情v1.58.0

algolia_client_search

AlgoliaSearch 库的一个子包,为 Dart/Flutter 应用提供增强搜索和发现功能的专用搜索功能。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
4.2万
喜欢数
6
Pub 分数
160

安装插件

flutter pub add algolia_client_search

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

algolia_client_search 包是一个 Dart/Flutter 库,旨在将 Algolia 强大的搜索和发现功能集成到应用程序中。它提供了一个简洁、类型安全的 API,用于执行搜索、管理索引以及在多个平台上处理自动补全功能。作为 AlgoliaSearch 生态系统的一部分,该包使开发者能够在 Flutter 应用中提供快速、相关且可扩展的搜索体验。该包支持实时结果、分面筛选和可自定义的排序,非常适合电子商务、内容发现和应用导航。

适合场景

  • 电子商务产品搜索
  • 应用中的内容发现
  • 实时自动补全
  • 用户驱动的筛选
  • 应用导航与搜索
  • 动态内容索引

主要特点

  • 快速、可扩展的搜索
  • 支持分面搜索
  • 自动完成和拼写容错
  • 索引管理 API
  • 实时结果更新
  • 类型安全的 Dart 接口

适合对象

  • 需要强大搜索功能的Flutter应用
  • 使用 Algolia 后端的开发人员
  • 包含大型数据集的应用程序
  • 需要即时搜索的项目
  • 优先考虑开发者体验的团队

使用建议

  • 需要 Algolia 账户和 API 密钥
  • 受限于 Algolia 的基础设施
  • 需要正确的索引配置
  • 可能需要额外设置才能使用高级功能
  • 依赖网络连接

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Algolia for Dart

The perfect starting point to integrate Algolia within your Dart project

Latest version Publisher

Flutter Guide • Community Forum • Stack Overflow • Report a Bug • Support

📚 Description

algoliasearch is a comprehensive Dart package that provides access to Algolia's robust search and insights features. It is an all-in-one solution designed to help you integrate Algolia within your Dart project seamlessly and efficiently.

The package currently offers the following clients:

  • Search Client: Allows you to leverage Algolia's search capabilities, including instant search results, search-as-you-type, and typo-tolerance.
  • Insights Client: Enables you to collect events related to your search and discovery experience, providing valuable insights into user behavior. With it, you can unlock powerful features such as recommendations, personalization, and smarter search results.
  • Search Lite Client: A lighter, search-only version of the library, perfect for projects that require search functionality without the need for features like indexing.

Future updates will include more clients to cover the entirety of Algolia's feature set, providing a complete toolset for building powerful, interactive search experiences in your Dart or Flutter application.

✨ Features

  • Low-Level HTTP Client: Provides a thin and minimal low-level HTTP client to interact directly with Algolia's API, giving you maximum control over your requests.
  • Cross-Platform Compatibility: Designed to work seamlessly on both native and web platforms, making it ideal for any Dart project.
  • Pure Dart Construction: Built with pure Dart for superior performance and maximum compatibility across Dart projects.

💡 Getting Started

Step 1: Add Dependency

To use this package in your project, add it as a dependency:

For Dart projects:
dart pub add algoliasearch
For Flutter projects:
flutter pub add algoliasearch
Step 2: Import the Package

You can now import the Algolia API client in your project and play with it.

import 'package:algolia_client_search/algolia_client_search.dart';
// Alternatively, you can import `algoliasearch_lite`, a **search-only** version of the library, if you do not need the full feature set:
// import 'package:algoliasearch/algoliasearch_lite.dart';

final client = SearchClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY');

// Add a new record to your Algolia index
final response = await client.saveObject(
  indexName: "<YOUR_INDEX_NAME>",
  body: {
    'objectID': "id",
    'test': "val",
  },
);

// Poll the task status to know when it has been indexed
await client.waitTask('<YOUR_INDEX_NAME>', response.taskID);

// Fetch search results, with typo tolerance
final response = await client.search(
  searchMethodParams: SearchMethodParams(
    requests: [
      SearchForHits(
        indexName: "<YOUR_INDEX_NAME>",
        query: "<YOUR_QUERY>",
        hitsPerPage: 50,
      ),
    ],
  ),
);

❓ Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client. You can also open a GitHub issue

Contributing

This repository hosts the code of the generated Algolia API client for Dart, if you'd like to contribute, head over to the main repository. You can also find contributing guides on our documentation website.

📄 License

The Algolia Dart API Client is an open-sourced software licensed under the MIT license.

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目

暂无相关数据。