Skip Navigation

[Resolved] Change Relevanssi Custom Fields Weight

This thread is resolved. Here is a description of the problem and solution.

Problem:

I added some custom fields as search term for Relevanssi, how can I change their Weights?

Solution:

You can follow Relevanssi document to setup the custom fields weight

Relevant Documentation:

https://www.relevanssi.com/knowledge-base/relevanssi-match/#customfield

This support ticket is created 3 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by xiaolinW 3 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#2072137

Hello, I added some custom fields as search term for Relevanssi, how can I change their Weights?

#2072199

你好,

这个问题在于Relevanssi插件,建议你参考Relevanssi文档进行设置:
hidden link
比如上面文档内提供的参考代码“Custom field -based weight”:
hidden link

在Toolset方面,如果你的custom fields是使用Toolset Types插件创建的,Toolset Types会添加“wpcf-”前置field slug,比如:
你在Toolset Types插件创建的custom field,使用了slug “my-field”,在你的PHP代码里面,你需要使用"wpcf-my-field",参考我们的文档:
https://toolset.com/documentation/customizing-sites-using-php/functions/

when you are accessing custom fields through native WordPress functions, you need to prepend the wpcf- prefix to the slug. Continuing from the above example, for native WordPress function to access the “House Price” field, you need to use the wpcf-house-price slug.

#2072657

My issue is resolved now. Thank you!