joppuyo / searchwp-finnish-base-forms
SearchWP plugin to add Finnish base forms in search index
Installs: 481
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 5
Type:wordpress-plugin
Requires
- danielstjules/stringy: ^3.1
- guzzlehttp/guzzle: ^6.3
- symfony/process: >=3.3
- yahnis-elsts/plugin-update-checker: ^4.4
- dev-master
- v3.2.0
- v3.1.0
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.4.0
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-feature/searchwp-4
- dev-dependabot/composer/guzzlehttp/psr7-1.9.1
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-feature/ffi
- dev-feature/cache
- dev-feature/improve-relevance
- dev-wordbases
This package is auto-updated.
Last update: 2024-11-04 17:23:46 UTC
README
SearchWP plugin to add Finnish base forms into search index using Voikko.
What does it do?
This plugin allows you to add base forms of Finnish words in SearchWP search index. For example for word koirillekin, tokens koirillekin and koira are saved in the index during indexing. Learn mode by reading this article (in Finnish).
This plugin is compatible with Polylang. If you have Polylang installed, it will only process content written in Finnish.
Options
API type
You can use bundled voikkospell binary (on a linux x64 system) to lemmatize the indexed terms.
There is also an option to use a system-wide voikkospell command line application if you have Voikko installed on your system.
It's also possible to set up an external Node.js API to access Voikko over HTTP. Using the binary or CLI application is much faster because it doesn't have the overhead of performing a HTTP request.
Special thanks to siiptuo for contributing voikkospell support for this plugin!
Add base forms to search query
Enable this option to add base forms to search queries entered by users.
Split compound words
Enable this option to split compound words during indexing (and for user queries if the above option is enabled). For example, the word kerrostaloille is transformed into tokens kerrostaloille, kerrostalo, kerros and talo in the search index.
Search result excerpts
It's possible to generate Google-style search result excerpts where the keywords are highlighted using searchwp_finnish_base_forms_get_excerpt($post, $options)
function. It takes the following parameters:
-
Post you want to create excerpt for
-
Array of options
length
: length of the excerpt, 300 characters by defaultquery
: current search query, by default it'sget_search_query()
fallback
Anonymous method that generates excerpt to display if the search query is not found in the post content, by default this will use 'excerpt' field and fall back to 'content' field. The text will be truncated according tolength
This function will automatically check all fields for the search terms that have been configured in SearchWP settings.
Requirements
- SearchWP 2.5 or later
- PHP 5.5.9
- One of the following:
- A x64 Linux or Mac server
- A server with voikkospell command line application installed
- A server with Node.js and about 1GB of spare RAM
Installation
- Download latest version from the releases tab
- Unzip the plugin into your
wp-content/plugins
directory - Activate SearchWP Finnish Base Forms from your Plugins page
Bundled voikkospell binary
- Go on the Plugins page, find the plugin, click Settings. For API Type select Voikko binary (bundled).
Voikkospell command line
- Install voikkospell on your server. On Ubuntu/Debian this can be done with
apt install libvoikko-dev voikko-fi
- Go on the Plugins page, find the plugin, click Settings. For API Type select Voikko command line.
Node.js web API
- Install and start Voikko Node.js web API.
- Go on the Plugins page, find the plugin, click Settings and enter the Node API URL there
After installation, remember to re-index the site from SearchWP settings page.