Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom query #11

Open
pratik9722 opened this issue Jan 27, 2021 · 4 comments
Open

Custom query #11

pratik9722 opened this issue Jan 27, 2021 · 4 comments

Comments

@pratik9722
Copy link

Please provide documentation for custom query
Can we use this plugin along with your plugin
https://github.com/devgeniem/redipress

Recommendations
Only read should happen from redis.
Write, update & delete should be perform at the same time on MySQL as well as redis so redis also has fresh data at each time still take the benifits of reads from the redis.

@foadyousefi
Copy link
Member

Thanks for the suggestion. There will be some changes to the organizational structure of the plugin very soon and in-depth documentation will be provided.

As for using it along with RediPress, I'm afraid it is not. Our plugin supports the latest versions of Redis and RediSearch since RediSearch 2.0 is completly re-written.

As for the recommendations, yes, only read happens in the Redis, create, update and delete posts, happens directly on MySQL and Redis automatically updates indexed data.

@gigabyteservice
Copy link

  1. what about the API endpoints e.g /wp-json/wp/v2/media
    all the data which we can see at the API endpoints also come from wp-redisearch? (meaning from Redis not MySQL correct?)
    if yes then what about custom API end Points

  2. If you can give us an idea about how we can create a custom post type or custom query that gives the benefits of Redis then it's very good.

@foadyousefi
Copy link
Member

foadyousefi commented May 3, 2021

So sorry for so late answer. Currently, the way this plugin setup is replacing query in the posts_request filter if it's search and main query. But if really necessary and you think can be useful, it can be added to all queries or at least the option to use it for WP_Query.

I think point 2 is out of this plugins scope dough.

@foadyousefi
Copy link
Member

Added a filter in which forces RediSearch to replace Wordpress post query.

apply_filters( 'wp_redisearch_force_redisearch', FALSE, $query ) ) You can return TRUE when your criterias are correct, so the plugin tries to fetch posts from RediSearch index instead of Database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants