WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
How to restrict search to custom field value (3 posts)

  1. Lumpysimon
    Member
    Posted 3 years ago #

    Hi

    Following on from my previous post: http://wordpress.org/support/topic/plugin-relevanssi-a-better-search-is-it-possible-to-restrict-to-custom-field-or-taxonomy-term

    With v1.4 can I now restrict a search to a particular custom field? e.g. I have a 'reviewer' custom field, so I want to only search this field, not the post content/title.

    Thanks
    Simon

  2. Mikko Saari
    Member
    Plugin Author

    Posted 3 years ago #

    No, it doesn't work like that...

    You can restrict search results to posts that either have certain custom field present (have a reviewer) or have a certain value for the custom field (have a certain reviewer), but you can't have Relevanssi search the custom fields only.

    With the way Relevanssi works, searching only for custom field content is possible, but restricting it to a certain custom field gets a bit tricky, as the index only has a column for "custom field", not each and every custom field.

  3. Lumpysimon
    Member
    Posted 3 years ago #

    Thanks for the explanation: I've actually realised I was unnecessarily overcomplicating things anyway - as so often, the simplest solution is best!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags