2017 © Pedro Peláez
 

craft-plugin craft3-weightedsearch

A remake of the weighted search plugin for Craft 2

image

venveo/craft3-weightedsearch

A remake of the weighted search plugin for Craft 2

  • Sunday, September 17, 2017
  • by ransom
  • Repository
  • 1 Watchers
  • 4 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Weighted Search plugin for Craft CMS 3.x

A remake of the weighted search plugin for Craft 2 by wja-no, (*1)

Usage

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

For more complete documentation, take a look at that repository., (*3)

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

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., (*5)

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., (*6)

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

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., (*8)

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)., (*9)

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later., (*10)

Installation

  1. Then tell Composer to load the plugin:, (*11)

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

The Versions

17/09 2017

dev-master

9999999-dev

A remake of the weighted search plugin for Craft 2

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft3 weighted search

17/09 2017

dev-develop

dev-develop

A remake of the weighted search plugin for Craft 2

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft3 weighted search

17/09 2017

1.0.0

1.0.0.0

A remake of the weighted search plugin for Craft 2

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft craft3 weighted search