Solr MultiCore搜索(Solr MultiCore Search)
我正在使用Apache Solr进行搜索。 我用它来提供个人用户搜索。 即每个用户都有一个单独的物理Lucene索引。 所以对于10位用户,我在磁盘上有10个独立的物理索引。
为了支持这些索引的搜索,我打算使用Solr MultiCore Feature 。 随着我一直在阅读的各种文章,它看起来像这样工作。
我真的不知道的是,当一个solr搜索者得到一个查询,而不是将查询发送给所有多核时,我该如何将查询集中到具有该特定用户索引连接的核心? 这是配置更改还是需要执行代码级别更改?
即我想发送查询只有一个solr核心(基于用户标识)。 这甚至有可能吗?
更新:根据其中一个解决方案,我可以在solrconfig.xml中添加多核,即在开始solr时,我需要提及核心(或者在我的情况下是用户)。 所以现在,如果我想添加一个新用户的索引,我可能需要停止solr,编辑其配置,添加该用户核心并再次启动solr。 有没有办法动态地将核心添加到正在运行的solr实例?
I am using Apache Solr for search. I use this to provide personal user-based search. i.e. each user has a separate physical Lucene Index. So for 10 users, I have 10 separate physical indexes on disk.
To support searches on these indexes, I am planning to use Solr MultiCore Feature. With the various articles I have been reading regarding this, it looks like this would work.
Where I am actually not sure is, when a solr searcher gets a query, instead of sending the query to all the multiple-cores, how do I funnel the query to that core which has that particular user's index connected to? Is this a config change or do I need to do code level changes?
i.e. I want to send the query to only one solr-core (based on userid). Is this even possible?
UPDATE: So according to one of the solutons I can add multi-cores in the solrconfig.xml i.e. at the time of starting solr I'll need to mention the cores (or in my case the users). So now, if I want to add a new user's index, I'll probably need to stop solr, edit its config, add that users core & start solr again. Is there any way to dynamically add cores to a running solr instance?
原文:https://stackoverflow.com/questions/5221132
最满意答案
尝试使用区分大小写整理来帮助您将密码与小写版本进行比较,如下所示:
(len([PASSWORD])>(5) AND [PASSWORD] like '%[0-9]%' AND [PASSWORD] <> Lower([PASSWORD]) COLLATE Latin1_General_CS_AI)
或者我自己的例子是这样的:
Declare @Password varchar(20) = 'Hello' if @Password <> Lower(@Password) COLLATE Latin1_General_CS_AI PRINT 'Upper' else PRINT 'lower'
Try using a Case Sensitive Collation to help you out and compare password with a lower case version of it like below using your code:
(len([PASSWORD])>(5) AND [PASSWORD] like '%[0-9]%' AND [PASSWORD] <> Lower([PASSWORD]) COLLATE Latin1_General_CS_AI)
Or my own example would be like this:
Declare @Password varchar(20) = 'Hello' if @Password <> Lower(@Password) COLLATE Latin1_General_CS_AI PRINT 'Upper' else PRINT 'lower'
相关问答
更多-
尝试这个: SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_ChannelPlayerSkins_Channels' - 编辑 - 当我原来回答这个问题的时候,我在想“外键”,因为原来的问题是关于发现“FK_ChannelPlayerSkins_Channels”的问题。 从那时起,很多人都评论过发现其他“约束”这里有一些其他的疑问: --Returns on ...
-
有可能,但添加没有名称的约束是一个非常糟糕的习惯 : CREATE TABLE tbl(SomeColumn VARCHAR(10) DEFAULT('test')) 将创建一个随机名称的CONSTRAINT 。 更好地利用它 CREATE TABLE tbl(SomeColumn VARCHAR(10) CONSTRAINT DF_YourTable_SomeColumm DEFAULT('test')) 这将做同样的事情,但会像你想要的那样命名约束。 如果在已部署的环境中运行升级脚本,这一点非常重要 ...
-
我会拆分你的任务。 首先,分配唯一约束(这可以是表键): CREATE UNIQUE INDEX IX_UQ ON Mine(ProductId, CountryId, ApplicationId) 这是为了进行简单的验证并改进触发器查询。 其次,您的检查需要涉及许多记录(不能使用CHECK约束)。 这是触发器的任务: CREATE TRIGGER trMine ON Mine FOR INSERT,UPDATE IF (EXISTS( SELECT Mark FROM ( ...
-
为什么不只是外键到另一个表并允许空值? 更好的方法是在另一个表中输入一个卡类型代码,然后存储一个密钥。 Why not just foreign key to another table and allow nulls? Even better would be to ahve a card type code in another table, and store a key to that.
-
检查约束(check constraint)[2022-03-20]
您的代码在rextester中有效 。 鉴于你在做什么,我建议宣布版本有5个字符: neEdition varchar(5) 要么: neEdition char(5) 这与检查约束更加一致。 You code works in rextester. Given what you are doing, I would recommend that the edition be declared to have 5 characters: neEdition varchar(5) or: neEditi ... -
尝试使用区分大小写整理来帮助您将密码与小写版本进行比较,如下所示: (len([PASSWORD])>(5) AND [PASSWORD] like '%[0-9]%' AND [PASSWORD] <> Lower([PASSWORD]) COLLATE Latin1_General_CS_AI) 或者我自己的例子是这样的: Declare @Password varchar(20) = 'Hello' if @Password <> Lower(@Password) COLLATE Latin1_G ...
-
SQL Server:检查约束以检查客户是否超过18(SQL Server : check constraint to check customers are over 18)[2022-09-30]
此条件在检查约束中无效,因为它是非确定性的。 如果时钟突然转回,那么有效的行现在可能无效。 约束将追溯无效。 您应该将此检查移至应用程序。 This condition is invalid in a check constraint because it is non-deterministic. If the clock is turned back suddenly rows that were valid could now become invalid. The constraint would ... -
我们可以在sql server的“Check”约束中使用“if else”吗?(Can we use “if else” in “Check” constraint in sql server)[2023-10-02]
您不能使用IF/ELSE ,但可以使用内联条件: CASE WHEN You cannot use IF/ELSE, but you can use inline conditionals: CASE WHEN -
SQL CHECK约束问题(SQL CHECK constraint issues)[2023-04-26]
SQL Server中没有==运算符。 检查null时你必须使用“是” 请试试这个: ((Length is null AND starttime is not null AND endtime is not null) OR (Length is not null AND starttime is null AND endtime is null)) HTH There is no == operator in SQL Server. While checking for null you have t ... -
SQL检查约束的使用(The Use of SQL Check Constraint)[2022-02-11]
试试这个: ALTER TABLEADD CONSTRAINT CHECK_YOURTABLE_COL CHECK(Col IN('IEU' , 'None IEU') OR Col LIKE '___/____') Col是具有CHECK约束的列 Try this one: ALTER TABLE ADD CONSTRAINT CHECK_YOURTABLE_COL CHECK(Col IN('IEU' , 'None IEU') ...