Title: Hintr &#8211; Lightning-Fast, Advanced Search Suggestions
Author: martincipriano
Published: <strong>2025 年 1 月 24 日</strong>
Last modified: 2025 年 1 月 26 日

---

搜索插件

![](https://ps.w.org/hintr/assets/icon-256x256.png?rev=3228063)

# Hintr – Lightning-Fast, Advanced Search Suggestions

 作者：[martincipriano](https://profiles.wordpress.org/martincipriano/)

[下载](https://downloads.wordpress.org/plugin/hintr.1.2.0.zip)

 * [详情](https://cn.wordpress.org/plugins/hintr/#description)
 * [评价](https://cn.wordpress.org/plugins/hintr/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/hintr/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/hintr/#developers)

 [支持](https://wordpress.org/support/plugin/hintr/)

## 描述

**Hintr** is a WordPress plugin designed to improve search by providing lightning-
fast suggestions. Easily configure which post types to pull search suggestions from.
You can also show suggestions if the search keyword is found in a post’s metadata,
such as price, SKU, serial number, etc.

**Features:**
 – Effortlessly select which post types search suggestions should 
be pulled from. – Show suggestions when the search keyword is found in a post’s 
metadata. – Customize search behavior for different input fields via data attributes.–
Lightweight and highly configurable, ensuring seamless integration.

This plugin is perfect for blogs, e-commerce sites, or any WordPress site that can
benefit from enhanced search capabilities.

### Usage

 * Automatic Application: Search suggestions are automatically applied to text inputs
   with the data attribute name=”s”.
 * Custom Implementation: To customize behavior, add the data-hintr attribute to
   a text input.
    - Override the default settings by assigning a JSON-formatted settings value
      to the data-hintr attribute.
    - Example:

### License

This plugin is licensed under the GNU General Public License v2.0 or later.
 You
may obtain a copy of the license at: https://www.gnu.org/licenses/gpl-2.0.html

## 屏幕截图

 * [[
 * Post type field in the settings determines where to pull the suggestions from.
   _Description: Displays post suggestions pulled from the selected post types._
 * [[
 * Custom field key input in the settings enables search using custom field value.
   _Description: Displays post suggestions if the keyword partially matches its 
   custom field value_
 * [[
 * Example use case. _Description: Searching for “capacitor” will display posts 
   with the keyword in their title. Searching “electronics” will show posts where
   the keyword is present in the posts custom field._

## 安装

 1. Download the plugin file and extract it.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Go to **Settings > Hintr** to configure the plugin options.

## 常见问题

### What does Hintr do?

Hintr enhances your search input with a dynamic list of suggestions. It allows you
to retrieve suggestions from specific post types and display posts when the search
keyword matches their metadata.

### Can I use this plugin with custom post types?

Yes! Hintr works with any public custom post type registered on your site.

### Do I need to code anything?

 * No coding required when using the global settings for effortless setup.
 * Fine-tune search suggestions for multiple search inputs with basic knowledge 
   of:
    - Writing a JSON string.
    - Using HTML data attributes.

### How can I apply different search suggestion settings to multiple search inputs?

To apply custom settings for each search input, add the `data-hintr` attribute to
the respective `<input type="text"> or <input type="search">` fields.

**Here’s what you can configure:**

 * `count` (int/string): The number of suggestions to display.
 * `search_in` (array): Define the post types and corresponding metadata to search
   against.
    - `key` (string): The post type from which suggestions will be pulled (e.g.,‘
      post’, ‘page’).
    - `value` (array): An array of meta keys that will be compared to the search
      keyword.

**Example json value for data-hintr attribute:**

    ```
    {
      "count": "10",
      "search_in": {
        "post": ["meta_key_1", "meta_key_2", "meta_key_3"],
        "page": ["meta_key_1", "meta_key_2", "meta_key_3"]
      }
    }
    ```

### Will this plugin slow down my site?

Hintr is optimized for speed, but performance can be affected by the number of posts
being searched.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Hintr – Lightning-Fast, Advanced Search Suggestions」是开源软件。 以下人员对此
插件做出了贡献。

贡献者

 *   [ martincipriano ](https://profiles.wordpress.org/martincipriano/)

[帮助将「Hintr – Lightning-Fast, Advanced Search Suggestions」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/hintr)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/hintr/)，查看[SVN仓库](https://plugins.svn.wordpress.org/hintr/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/hintr/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/hintr/)。

## 更新日志

#### 1.0.0

 * Added: Admin settings page for selecting post types and metadata.
 * Added: REST API endpoint based on selected settings.
 * Added: JavaScript to store posts in the browser’s local storage.
 * Added: JavaScript to show search suggestions in a dropdown.

#### 1.1.0

 * Added: Count limit field in settings page.
 * Added: JavaScript to limit the number of suggestions displayed in the dropdown.

#### 1.1.1

 * Apply fixes for text domain mismatch required by WordPress

#### 1.1.2

 * Cache the database query results for getting metadata used by a post type in 
   the settings page

#### 1.1.3

 * Added donation link and screenshots to the readme file.

#### 1.1.4

 * Added: Add a suggestion count to improve performance and prevent showing too 
   many suggestions.
 * Added: Added a script to prevent access to the main plugin file.
 * Updated: assets/js/hintr.js to replace the use of hashed post. Instead check 
   when the local storage was last updated before updating the local storage.
 * Updated: Updated slimselect.js to use the uinminified version.
 * Deleted: Remove load_plugin_textdomain() since it is not being used since WordPress
   4.6.

#### 1.2.0

 * Added: Added a checkbox input in the settings to allow the users to disable the
   suggestions from the default WordPress search.
 * Added: Added a condition in the javascript before applying the suggestions to
   default WordPress search inputs.
 * Added: Save the suggestions to a json file in the uploads directory so a query
   to the database isn’t required every time a local storage is going to be created.
 * Removed: Remove the scripts for creating a custom endpoint.

## 额外信息

 *  版本 **1.2.0**
 *  最后更新：**1 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.8 或更高版本 **
 *  已测试的最高版本为 **6.7.5**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/hintr/)
 * 标签
 * [search](https://cn.wordpress.org/plugins/tags/search/)[suggestion](https://cn.wordpress.org/plugins/tags/suggestion/)
 *  [高级视图](https://cn.wordpress.org/plugins/hintr/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/hintr/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/hintr/reviews/)

## 贡献者

 *   [ martincipriano ](https://profiles.wordpress.org/martincipriano/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/hintr/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.me/martincipriano)