• Hello,

    For purposes , i’ve created a new table named post_archived and I would like to change the function of native wordpress research so it can go search also in this new table.
    This new table have the same field names as the post table. I did not find the files for the search engine , if someone has already done this , I’m interested ??

    Where can i custom the querry to add my new table ?

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there thecatz,

    This would be extremely difficult. The native WordPress search uses the WP_Query object which is set up to use the posts table. The only way around this as far as I can think right now is if you write a custom search UI and query yourself.

    I would suggest using a custom post type instead. Custom post types are highly configurable (you can choose to display/hide them in the front/backend, add specific features and so on) and can be included in searches and other queries.

    I suggest taking a look at the Custom Post Types article and the documentation on register_post_type() to get started.

    Thread Starter thecatz

    (@thecatz)

    thx for your help, i’ll take a look with your solution.

    Thread Starter thecatz

    (@thecatz)

    This solution does not work in my case, because I have a lots of posts on my new mysql table “posts_archive” and I can not creat them one by one. And i don’t want to use the posts mysql regular table because it idling my wordpress…

    Or perhaps i’ve missed something with custom post, is possible to say to wordpress find my custom post in “posts_archive” ans not in “posts” ?

    You can use some MYSQL to add your posts to the regular posts table. Unless you have millions and millions of posts I doubt that your tables would slow down WordPress.

    It is not possible to use a custom table instead of the posts table, but I would strongly suggest finding a way to migrate your data into the actual posts table. Even if it takes some time now, it will save you a LOT of headaches in the future!

    Daniel

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom research ?’ is closed to new replies.