romaten1/craft3-weightedsearch 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

romaten1/craft3-weightedsearch

Composer 安装命令:

composer require romaten1/craft3-weightedsearch

包简介

A remake of the weighted search plugin for Craft 2

README 文档

README

A remake of the weighted search plugin for Craft 2 by wja-no

Usage

This plugin exposes the template variable/function: craft.weightedSearch.substringSearch(query, [sections])

For more complete documentation, take a look at that repository.

This works exactly like the Craft 2 version of this plugin, where search results are weighted based on exact match and number of matches.

The return results of the search differs from the traditional Craft search query in that it returns some extra meta information about the search results.

Each result has these fields: entry, excerpt and score. The excerpt is in HTML format, where each instance of the search string has been marked up with the mark element.

You can leverage entry as you would any other ElementCriteriaModel (eg. {{searchresult.entry.title}}).

Editorially prioritizing an entry for a search term

To enable manual prioritization of entries, create a field of type Tags, give it the handle prioritizedSearchTerms and add it to the relevant entry types.

To give an entry prioritization in the search results for a given term, add that term as a tag in the entry's prioritizedSearchTerms field. The entry will receive a significant boost to its score, which will most likely be enough to "win" over any other entry (that doesn't also have the same tag).

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

  1. Then tell Composer to load the plugin:

     composer require romaten1/craft3-weightedsearch
    
  2. In the Control Panel, go to Settings → Plugins and click the “Install” button for Better Search.

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固