Meilisearch Cloud 入门

    本教程将引导您完成设置 Meilisearch Cloud、创建项目和索引、向其中添加文档以及使用默认 Web 界面执行首次搜索。

    您需要一个 Meilisearch Cloud 帐户才能继续学习。如果您没有帐户,请访问 https://cloud.meilisearch.com/register 注册一个 14 天免费试用帐户。

    创建项目

    要使用 Meilisearch Cloud,您必须首先创建一个项目。项目充当索引、任务、计费和与 Meilisearch Cloud 相关的其他信息的容器。

    单击顶部菜单上的“新项目”按钮。如果您有免费试用帐户,并且这是您的第一个项目,则该按钮将显示“开始免费试用”

    The Meilisearch Cloud menu, featuring the "New Project" button

    将您的项目命名为 meilisearch-quick-start 并选择离您最近的区域,然后单击“创建项目”

    A modal window with two mandatory fields: "Project name" and "Select a region"

    如果您不使用免费试用帐户,您还必须根据数据集的大小和每月搜索次数选择计费方案

    A variation of the previous modal window with an extra mandatory field: "Select a plan". There are a few billing plan options

    创建项目可能需要几分钟。查看项目列表以跟踪其状态。项目准备就绪后,单击其名称以转到项目概览页面

    Meilisearch Cloud's main list of projects. It features only one project, "meilisearch-quick-start", and shows information such as API keys, URL, and number of monthly searches

    创建索引并添加文档

    创建项目后,您必须索引要搜索的数据。Meilisearch 将您添加到索引中的数据存储和处理在索引中。单个项目可能包含多个索引。

    首先,单击项目页面菜单中的索引选项卡

    The project overview page, featuring a secondary menu with several links. A red arrow points at a menu item: "Indexes"

    这将引导您进入索引列表。单击“新建索引”

    An empty list of indexes in this project with a button on the upper right corner

    在名称字段中写入 movies,然后单击“创建索引”

    A modal window with one mandatory field: "Index name"

    创建索引的最后一步是向其中添加数据。选择“文件上传”

    Another modal window with three options. A red arrow points at the chosen option, "File upload"

    Meilisearch Cloud 将要求您提供数据集。要继续学习,请使用此电影列表。将文件下载到您的计算机,将其拖放到指示区域,然后单击“导入文档”

    Another modal window with a large drag-and-drop area. It indicates a file named "movies.json" will be uploaded

    Meilisearch Cloud 将索引您的文档。这可能需要一些时间。单击“查看索引列表”并等待。完成后,单击“设置”以访问索引概览

    A list of all indexes in this project. It shows a single index, movies, and indicates it contains over 30,000 documents

    搜索

    上传和处理完所有数据后,最后一步是运行一些测试搜索,以确认 Meilisearch 正在按预期运行。

    单击面包屑菜单上的项目名称以返回到项目概览

    The index list page. A red arrow points at the breadcrumb menu

    Meilisearch Cloud 附带搜索预览界面。单击“搜索预览”以访问它

    The project overview page. A red arrow points at a menu item named "Search preview"

    最后,尝试搜索一些电影,例如“Solaris”

    The search preview interface, with "solaris" written in the search bar

    如果您可以看到结果在您键入时出现,那么恭喜您:您现在了解了使用 Meilisearch Cloud 的所有基本步骤。

    下一步

    本教程教您如何使用 Meilisearch Cloud 的界面来创建项目、向其中添加索引以及使用搜索预览界面。

    在大多数实际应用场景中,您将创建自己的搜索界面,并通过 Meilisearch 的 API 检索结果。要了解如何使用命令行或您首选语言的 SDK 添加文档和进行搜索,请查看 Meilisearch 快速入门