如何通过BookSleeve搜索Redis中的内容值 [英] How to search content value in redis by BookSleeve

查看:96
本文介绍了如何通过BookSleeve搜索Redis中的内容值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用redis搜索内容,这有可能吗?

I want to search in content use redis ,Is such a thing possible؟

例如:

class Post          
{
    public string Id { get; set; }

    public string Content { get; set; }

    public bool Deleted { get; set; }
}

我使用c#和BookSleeve,如果发布的内容"属性为false,我想在发布的内容"属性中搜索一个单词,我可以使用HSET并序列化此对象以存储在redis或SADD或..中.

I use c# and BookSleeve ,I want to search a word in "Content" property of post if the "Deleted" property of post is false, i can use HSET and serialize this object to store in redis or SADD or ...

1-存储该对象的最佳方法是什么? 2-最好的方法是什么 搜索和筛选对象以退货?

1- What is the best way to store this object? 2- What is the best way to search and filter object for return?

[更新]

我可以使用 SISMEMBER 在redis中进行搜索,仅用于确切的单词或短语,但我想搜索像 KEYS模式

I can search in redis using SISMEMBER just for the exact word or phrase but i want to search value like KEYS pattern

[更新]

stackexchange白色怎么办?

How do stackexchange whit redis?

[更新]

非常感谢 Marc Gravell ,我发现 ElasticSearch 的Mpdreamz/NEST"rel =" nofollow noreferrer> NEST .但是我没有意识到 Redis 与ElasticSearch之间的关系.我将建立一个社交网络,想知道您是否需要使用Redis的某些部分以及ElasticSearch的某些部分,或者将它们组合使用.我在项目的哪一部分使用Redis,ElasticSearch的哪些部分以及应该使用的哪些部分组合使用.

thanks a lot Marc Gravell , I found NEST for ElasticSearch. But I did not realize how the relation between Redis and ElasticSearch. I'll build a social network and would like to know whether you have some parts Redis and some parts of ElasticSearch should be used or a combination of them.what part of the project i use Redis and which parts ElasticSearch use and which parts should be combined use.

谢谢

推荐答案

扫描可能用于这样做,但我不建议这样做. Redis是一个键/值存储,您应该为此使用它.如果要搜索文本,则应使用为其创建的另一个数据库,例如,用于长文本的ElasticSearch或用于短文本的MongoDB或经典RDBMS.

SCAN could be maybe used to do this, but I wouldn't suggest it. Redis is a key/value store and you should use it for that. If you want to search for text, than you should use another DB which is made for it, like ElasticSearch for long texts or MongoDB or classical RDBMS for shorter texts.

NoSQL背后的想法是使用正确的工具完成工作,因此将redis用作键/值存储,主要用于在另一个DB中缓存数据和搜索文本.

The idea behind NoSQL is to use the right tool for the job, so use redis as a key/value store mostly for caching data and search texts in another DB.

这篇关于如何通过BookSleeve搜索Redis中的内容值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆