我想从匿名关系( childDocuments )转变为已标记。
在测试过程中,将文档以相同的架构和文档集成到Solr中时,检测到性能下降。
Solr(8.1.1)配置(本地,1个节点,默认设置):solr -e cloud
测试:多次启动500个文档的整合并计算平均整合时间。
关系破裂的例子:
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"])
{
static dispatch_once_t once;
dispatch_once(&once, ^ {
NSLog(@"Do it once");
NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar] ;
NSDate *now = [NSDate date];
NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:now];
[components setHour:13];
[components setMinute:1];
UILocalNotification *notification = [[UILocalNotification alloc]init];
notification.fireDate = [calendar dateFromComponents:components];
notification.repeatInterval = kCFCalendarUnitDay;
[notification setAlertBody:@"AM U got notification!!!"];
// notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
[components setHour:17];
[components setMinute:28];
notification.fireDate = [calendar dateFromComponents:components];
notification.repeatInterval = NSCalendarUnitDay;
[notification setAlertBody:@"PM U got notification!!!"];
// notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
});
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
匿名关系示例:
{
"id": "parent_xxx",
"items": [{"id": "child_xxx"}]
}
{
"id": "parent_xxx",
"_childDocuments_": [{"id": "child_xxx"}]
}
结果:
500个具有匿名关系的文档〜29ms
500个文档,具有标记关系〜981ms
使用命名关系时Solr是否正常?
我无法找到有关此的任何信息。 20-30倍的性能差异确实很奇怪。