自定义Solr完全导入(Custom Solr Full Import)
我有一个solr核心core1,它有几个Facet类型,我想为它们实现自定义导入。 例如:我有以下方面类型:
- Facet1
- Facet2
- Facet3
当我使用数据导入处理程序时,出于商业原因我不想做“delta”,我只想对Facet1和Facet2进行清理/完全导入,而不用单独使用Facet3。 这在Solr有可能吗?
任何帮助/方向表示赞赏。
I have a solr core core1, which has a couple of Facet Types and I want to implement a custom Import for them. For eg: I have the Following Facet Types:
- Facet1
- Facet2
- Facet3
When I use the Data Import Handler, I don't want to do the "delta" for business reasons, and I just want to do a clean / Full-Import for Facet1 and Facet2 and leave alone Facet3. Is this possible in Solr?
Any help / direction is appreciated.
原文:https://stackoverflow.com/questions/26370361
最满意答案
segue每次都会创建一个新的
EditViewController
。 要向前传递数据,您需要将数据分配给EditViewController
属性,然后将该数据复制到viewDidLoad
方法中的titleTextView.text
中。 这是必要的,因为@IBOutlet
没有设置,并且在prepareForSegue
运行时仍然是nil
。所以:
- 将属性
var textToEdit = ""
到EditViewController
。- 在
prepareForSegue
,设置addTitleViewController.textToEdit = /* the text you want to edit */
- 在
EditViewController
viewDidLoad
中,设置titleTextView.text = textToEdit
。注意:您的
delegate
应该被声明为weak
以避免保留周期(这将导致您通过永不释放EditViewController
来泄漏内存。您的@IBOutlet
也应该被声明为weak
。The segue will create a new
EditViewController
every time. To pass data forward, you will need to assign the data to anEditViewController
property and then copy that data intotitleTextView.text
in theviewDidLoad
method. This is necessary because the@IBOutlet
s are not set up and are stillnil
whenprepareForSegue
runs.So:
- add the property
var textToEdit = ""
to yourEditViewController
.- In
prepareForSegue
, setaddTitleViewController.textToEdit = /* the text you want to edit */
- In
viewDidLoad
ofEditViewController
, settitleTextView.text = textToEdit
.Note: Your
delegate
should be declaredweak
to avoid a retain cycle (which will cause you to leak memory by never freeingEditViewController
s. Your@IBOutlet
s should also be declaredweak
.
相关问答
更多-
委托方法向前传递数据(Delegate method to pass data forward)[2023-06-14]
segue每次都会创建一个新的EditViewController 。 要向前传递数据,您需要将数据分配给EditViewController属性,然后将该数据复制到viewDidLoad方法中的titleTextView.text中。 这是必要的,因为@IBOutlet没有设置,并且在prepareForSegue运行时仍然是nil 。 所以: 将属性var textToEdit = ""到EditViewController 。 在prepareForSegue ,设置addTitleViewContr ... -
将反射方法作为参数传递给另一个反射方法作为委托(Pass reflected method as parameter to another reflected method as delegate)[2022-12-09]
您应该明确指定数组类型: miForFunkA.Invoke(sourceOfFunkA, new object[] { methodInfo.Name, Delegate.CreateDelegate(typeof(Action), miForFunkB) }); 如果这不能解决您的问题,您应该编辑您的问题,以便更清楚您正在尝试做什么,所涉及的所有变量的声明,您现在拥有的代码,它的作用以及与您的不同之处想做。 You should be to specify the array type ... -
如何通过CRTP将lvalue引用传递给std :: forward?(How does it pass lvalue reference to std::forward with CRTP?)[2022-11-12]
你打电话时: container.add(data_a); // ^^^^^^^^^^^ 显式提供模板参数意味着编译器不会推导出模板参数(即,您没有获得转发引用行为)。 使用DataClassA作为模板参数实例化add意味着它的签名是: void add(DataClassA&& tag) 这是一个右值引用,而不是转发引用,因此左值参数不能绑定到它。 要使用完美转发,必须让编译器从参数中推导出模板参数。 基于参数的值类别,有三种可能的推论( T , T& ... -
PFQuery在不使用委托的情况下返回数据后调用方法(Call a method after PFQuery returns data without using delegate)[2023-05-31]
我可以让这件事工作的唯一方法是使用回调,如评论中的帖子所述。 这不是我想要的理想解决方案,但我想这将是必须的。 我将此问题标记为已结束。 The only way I could get this thing to work was to use call backs, as mentioned in the post in the comment. This wasn't the ideal solution that I was looking for, but I guess this will ha ... -
通过Google AdMob插页式委托方法传递segue数据(Passing segue data through a Google AdMob interstitial delegate method)[2022-11-30]
一种解决方案是在您出示插页式广告时清除您的IBAction中的计数,然后当插页式广告被删除时,如果您有IBOutlets,则可以使用按下的按钮调用您的servicesButton函数。 func interstitialDidDismissScreen(ad: GADInterstitial!) { self.servicesButton(buttonThatWasPressed) } 这将回忆你所有的逻辑。 另一种方法是为新视图标题设置一个类级变量,并设置当按下按钮时,无论你在哪里调用pres ... -
这是否意味着任何这样的代表被单独翻译(编组?)为一个静态函数... 是的,你猜对了。 不完全是“静态函数”,CLR内部有一大堆代码可以执行这种魔法。 它为thunk自动生成机器代码,以适应从本机代码到托管代码的调用。 本机代码获取指向该thunk的函数指针。 参数值可能必须被转换,这是一种标准的编码编组任务。 并且总是随时调整来匹配管理方法的调用。 挖掘存储的委托的目标属性以提供this属性是其中的一部分。 它跳过堆栈帧,绑定到前一个托管帧的链接,因此GC可以看到它再次需要查找对象根。 然而,有一个令人讨厌 ...
-
与在服务器端发生的forward不同, sendRedirect导致浏览器向重定向位置发起新请求,这意味着第二个语句为真。 Unlike forward which happens on the server-side, sendRedirect causes the browser to initiate a new request to the redirect location, which means the second statement is true.
-
您需要在协议中定义-printThis并使A实现此协议。 您还需要将委托标记为符合此委托。 即: @protocol Printer
- (void)printThis; @end @interface A : NSObject //... @end @interface B : //... @property (nonatomic, weak) id delegate; @end ARC需要了解方法调用的接口才能正确管理内存。 如果 ... -
首先你应该像这样改变你的协议: @protocol CoreDataDelegate //- (NSMutableArray *) fetchCoreData; - (void) getMyLocationEntityArray:(NSMutableArray *)entityArray; @end 您将MapViewController设置为响应您的协议CoreDateDelegate 。 所以,我想你在MapViewController ListTableViewController你的ListT ...
-
不要将代码放在ViewControllerB类中,这将导致recursive loop 。 这是一个自我调用的循环,使循环永久化。 在viewDidLoad ,代码在加载视图时执行。 所以你正在加载一个视图,然后创建一个新的ViewControllerB对象,并加载它,这将反过来创建一个ViewControllerB ... 尝试将此代码放在ViewControllerA类中,在-viewDidAppear 。 每次回来时,代码都会再次执行,创建一个新的ViewControllerB并推送到堆栈。 看看我在 ...