Support » Plugin: Pods - Custom Content Types and Fields » Inherited a site with Pods – How to search pods?

  • Resolved GeeWhiz

    (@geewhiz)


    Hello-

    I have inherited a site that has thousands of entries in a Pod custom post type. My problem is that the site is using a custom search that is looking directly into the SQL and is very broken and un-optimized.

    I tried using a search plugin like Relavansii and also default WordPress but neither appears to be able to search how Pods stores information.

    How do people easily and clearly set up a search with Pods?

    https://wordpress.org/plugins/pods/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jim True

    (@jimtrue)

    If your Pods are Custom Post Types, Relevanssi can search the Post Meta that Pods stores it’s information within, you just have to index those post types.

    You also need to make sure that the ‘Exclude from Search’ isn’t checked on your individual Pods under Pods Admin, Edit/Manage Pods and within each pod, the tab marked ‘Advanced Options’. If those are checked, they’ll be blocked by both Relevansii and default WordPress.

    Check those settings and see if it makes a difference, because that’s what most folks do (make sure their Pods are visible to Search (not excluded) and with Relevansii.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    If your pod is an Advanced Content Type, you can use Pods find() method to pass in your query (SQL syntax, or an array of fields in meta_query syntax).

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Also, if you’re using find(), you can make use of filters() to show a text search box, and potentially dropdowns for relationship fields to further filter results by.

    If you want paginated results (which I recommend limiting your results to 10-30 results per page), you can use pagination().

    The Pod type is an “Advanced Content Type” which is code for makes it really hard to search, maybe?

    Having to manipulate SQL queries to get search results is not ideal by any means. This is 2016!

    Is there a way to make whatever an Advanced Content Type is into a Custom Post Type? I don’t think there is any reason, at least not known to me, that this is set up this way. The issue is there are thousands of entries in here and unfortunately it was set up this way.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    When you use the filters() method, searching and filtering is built-in and handled automatically, which means you won’t have to write any custom SQL or find() queries.

    We’re working on an migration plugin that migrates from Pod type A to Pod type B (any types), that’s not ready yet but if you hop into our Slack chat, we might be able to steer you down that path if you’re familiar with PHP / SQL.

    Advanced Content Types aren’t enabled in Pods by default and aren’t the first choice made available (Custom Post Types are). So I can totally understand that it’s frustrating for you at this point not having a say in how the data was structured. That’s a decision someone either made lightly or misunderstood the ramifications of having data in custom tables like ACTs have.

    We’ll certainly try to help you out here, we don’t want you to be stuck šŸ™‚

    Thank you for your assistance so far.

    I have set up a new template with some modified code from your examples on the Filters() page. *Disclaimer: I have never used pods or am not very familiar with what i’m doing. Do you have tutorials? The documentation is great, but for someone with no familiarity with this system it’s going to be difficult getting up to speed efficiently. How can I get up to speed?

    I have a set of code which is searching the site and given my single test, did return the correct result when searching for a specific attribute of a given item in the ACT.

    However, the search just returns a text based without links. I found a param called “detail_url” but that doesn’t seem like what I want. How do I actually link to the pages of the items searched?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Inherited a site with Pods – How to search pods?’ is closed to new replies.