开发者 | msaari |
---|---|
更新时间 | 2024年4月4日 13:36 |
捐献地址: | 去捐款 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.5 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
wp_posts
database table by three). If your hosting setup has a limited amount of space for database tables, using Relevanssi may cause problems. In those cases use of Relevanssi cannot be recommended.
Key features
You can find solutions and answers at the Relevanssi Knowledge Base.
Answers to many common problems can be found from the contextual menu. Just click "Help" in the top right corner of your WordPress admin dashboard on the Relevanssi settings page.
If you the results don't change after installing and activating Relevanssi, the most likely reason is that you have a call to query_posts()
on your search results template. This confuses Relevanssi. Try removing the query_posts()
call and see what happens.
Please read Words with punctuation can't be found. This is a Relevanssi feature, but you can fix it from Relevanssi indexing settings.
See the top of the admin menu. There's 'User searches'.
Relevanssi stores the relevance score it uses to sort results in the $post variable. Just add something like
echo $post->relevance_score
to your search results template inside a PHP code block to display the relevance score.
Relevanssi offers Google-style "Did you mean?" suggestions. See "Did you mean" suggestions in the Knowledge Base for more details.
It's the basic weighing scheme used in information retrieval. Tf stands for term frequency while idf is inverted document frequency. Term frequency is simply the number of times the term appears in a document, while document frequency is the number of documents in the database where the term appears. Thus, the weight of the word for a document increases the more often it appears in the document and the less often it appears in other documents.
Each document database is full of useless words. All the little words that appear in just about every document are completely useless for information retrieval purposes. Basically, their inverted document frequency is really low, so they never have much power in matching. Also, removing those words helps to make the index smaller and searching faster.
relevanssi_searchform_dropdown_args
filters the arguments for wp_dropdown_categories()
in search forms.post__in
and post__not_in
and likewise for parent__in
and parent__not_in
.post_status
is no longer available as a query parameter.relevanssi_highlight_regex
makes it possible to adjust the regex used for highlighting.relevanssi_excerpt_custom_fields
filters the list of custom fields used for creating the excerpt.relevanssi_phrase_custom_fields
filters the list of custom fields used for phrase matching. Return an empty array to disable phrase matching in custom fields.relevanssi_phrase_taxonomies
filters the list of taxonomies used for phrase matching. Return an empty array to disable phrase matching in taxonomies.action
query variable being a non-string.relevanssi_excerpt_specific_custom_field_content
filters the excerpt custom field content if relevanssi_excerpt_specific_fields
is enabled.relevanssi_get_custom_field_content()
function now returns an array instead of string. If relevanssi_excerpt_specific_fields
is off, the previous string return value is returned as a single-item array with the string in index 0. If the setting is on, the array keys are the field names.wp_insert_site
(priority 10) to wp_initialize_site
(priority 200) in order to avoid trouble.relevanssi_highlight_query
lets you modify the search query for highlighting.relevanssi_blocked_field_types
can be used to control which ACF field types are excluded from the index. By default, this includes 'repeater', 'flexible_content', and 'group'.relevanssi_acf_field_object
can be used to filter the ACF field object before Relevanssi indexes it. Return false to have Relevanssi ignore the field type.the_permalink
hook and instead uses post_link
and other similar hooks.relevanssi_add_highlight_and_tracking
can be used to force Relevanssi to add the highlight
and tracking parameters to permalinks.max_allowed_packet
size on the debug tab.highlight
parameter.