• Resolved Jon Schroeder

    (@jonschr)


    I’m wondering if you have an integration with Metabox.io’s Relationships addon. It’s basically the continuing-to-work version of Posts to Posts, allowing for many to many connections, and I was hoping that it’s something you’d consider allowing indexing for (or point me toward how to do it).

    I’m running Relevanssi on this site, and it’s being used already for the main text search on the home page and the Apartment Search page linked above. In this case, the Properties each have Neighborhoods they’re connected to, and I’d love to be able to search for those neighborhoods in the main search box (as we already do for cities and zip codes, which are simply custom meta for the Properties content type).

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    There’s nothing in Relevanssi that stops you from making those connections between posts. It’s not something Relevanssi can do automatically, because there’s no set way that kind of thing always works: every use case will have different relationships and different content that will be indexed from the related posts.

    The key here is the relevanssi_content_to_index filter hook. Add a function to that hook that for each property fetches the related neighborhoods, reads in those posts and adds whatever content it is you want from the neighborhoods to the properties posts.

    Thread Starter Jon Schroeder

    (@jonschr)

    Wow, that sounds awesome, actually. Thanks; this is a fantastic answer.

    Does this mean that I could programatically (in this plugin) detect whether Relevanssi is installed, then essentially preselect the stuff that I want indexed for a given content type as well (meta fields and the like?).

    Plugin Author Mikko Saari

    (@msaari)

    I’m not sure I understand what you’re asking here exactly, but I suppose the answer is yes; Relevanssi has enough filter hooks that you really do get full control over what goes in the index for each post.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Metabox.io Relationships integration’ is closed to new replies.