在Solr数据导入处理程序中定义嵌套实体(Defining nested entities in Solr Data Import Handler)
让我先说一下,我已经完成了关于这个主题的所有事情,包括Solr文档和所有的SO问题。
我有一个Solr实例,使用JDBC驱动程序通过Data Import Hanlder从MSSQL中提取数据。 数据出来了,但它不像我预期的那样基于Solr DIH文档构建
<document> <entity> <entity /> </entity> </document>
我已经尝试了所有的属性,如rootEntity,flatten,使用CachedSqlProvider等。multiValued =“True”结果结束
docs [ { recordId: '1234', name: 'whatever' subrows_col1: ['x','y','z'] subrows_col2: ['a','b','c'] } ]
当我在找
docs [ { recordId: '1234', name: 'whatever' subrows: [{ col1: 'x', col2: 'a' }, { col1: 'y', col2: 'b' }, { col1: 'z', col2: 'c' }] } ]
我已经看到了块连接的东西,但我很困惑它到底在哪里。 我补充说
<add> <doc> <field /> <doc> <field /> </doc> <doc> </add>
到DIH requestHandler,但它什么也没做。 我将它添加到/ update requestHandler中,并且出现错误。 我不知道应该去哪里。 它只在查询过程中起作用,还是仅在通过/ update将数据推送到solr时才起作用?
我在哪里定义文档的结构? 我尝试了架构中的嵌套字段,DIH配置中的实体以及requestHandlers中的块连接内容。 没有任何工作。
显然我错过了一些东西。
Let me preface by mentioning that I've been through everything I could find about this topic including the Solr docs and all of the SO questions.
I have a Solr instance that I've setup with a Data Import Hanlder to pull in data from MSSQL using the JDBC driver. The data comes in, but it isn't structured as I'd expect based on the Solr DIH documentation
<document> <entity> <entity /> </entity> </document>
I've tried all the attributes like rootEntity, flatten, using CachedSqlProvider, etc. With multiValued="True" The result ends up
docs [ { recordId: '1234', name: 'whatever' subrows_col1: ['x','y','z'] subrows_col2: ['a','b','c'] } ]
When I'm looking for
docs [ { recordId: '1234', name: 'whatever' subrows: [{ col1: 'x', col2: 'a' }, { col1: 'y', col2: 'b' }, { col1: 'z', col2: 'c' }] } ]
I've seen the block-join stuff, but I'm confused as to where it goes. I added
<add> <doc> <field /> <doc> <field /> </doc> <doc> </add>
to the DIH requestHandler, but it did nothing. I added it to the /update requestHandler and I got an error. I have no clue where that is supposed to go. Does it only work during a query or is it only for when you push data to solr via /update?
Where do I define the structure for the document? I tried nested fields in the schema, entities in the DIH config and the block-join stuff in the requestHandlers. nothing has worked yet.
Obviously I'm missing something.
原文:https://stackoverflow.com/questions/24920305
最满意答案
在你的代码中
pushQuery.whereNotEqualTo("user", ParseUser.getCurrentUser()); pushQuery.whereEqualTo("user", ParseUser.getCurrentUser());
这两行是不兼容的,你应该删除“whereEqualTo”行。
您可以做的另一件事是回调:
... public void done(ParseException e){ if(e!=null) e.printStackTrace(); ... }
检查是否有错误
In your code
pushQuery.whereNotEqualTo("user", ParseUser.getCurrentUser()); pushQuery.whereEqualTo("user", ParseUser.getCurrentUser());
These two lines are incompatible, you should remove the "whereEqualTo" line.
Another thing you can do is in the callback:
... public void done(ParseException e){ if(e!=null) e.printStackTrace(); ... }
To check if there were errors
相关问答
更多-
由于使用推送需要在您的服务器和每个客户端之间维护一个开放的HTTP连接,因此我还会进行轮询 - 这不仅会消耗大量的服务器资源,而且还会更加棘手像提到的亚光b一样实施。 我使用轮询的经验是,如果在足够繁忙的站点上有足够频繁的轮询时间间隔,您的Web服务器日志可能会很快得到轮询请求。 编辑(2017) :我想说你现在的选择是在websockets和长轮询之间(在另一个答案中提到)。 听起来像长时间轮询可能是正确的选择,基于问题提到的通知不需要实时接收的方式,不频繁的轮询期间会很容易实现,并且不应该对您的服务器征 ...
-
registerHandler()中的回调函数以Json格式从服务器接收消息。 您可以通过message.notification获取您的自定义消息,其中通知是要在服务器端设置的唯一密钥。 The callback function in registerHandler() receive message from server in Json form. You can get your custom message by message.notification where notification i ...
-
根据此处的文档: https://parse.com/docs/push_guide#sending-queries/Android 第一步是在您的安装中存储对当前用户的引用,如果您还没有: // Associate the device with a user ParseInstallation installation = ParseInstallation.getCurrentInstallation(); installation.put("user",ParseUser.getCurrentUse ...
-
这就是它应该出现的方式 - 用于开发的“可配置”和用于分发的“启用”。 但它也适用于开发。 That's how it should appear - "Configurable" for development and "Enabled" for distribution. But it'll work for development as well.
-
好吧,这是我的愚蠢错误。 我正在使用Pushy 。 您可以像这样指定环境: apnsClient.connect(ApnsClient.PRODUCTION_APNS_HOST); 不幸的是我之前已经指定了DEVELOPMENT_APNS_HOST。 看来当你使用TestFlight时,你必须指定生产apns主机。 感谢所有看过这个问题并回答的人。 ok, this was my silly error. I am using Pushy. You specify the environment like ...
-
也许你正在寻找这样的东西。 也许这有助于https://github.com/phonegap-build/PushPlugin http://devgirl.org/2013/07/17/tutorial-implement-push-notifications-in-your-phonegap-application/如果你想要的话用PHP的东西然后看看这个http://mobile.dzone.com/articles/sending-android-push Maybe you are lookin ...
-
我强烈建议使用Pushwoosh标签(在服务器端过滤)。 但是,如果您需要过滤客户端 - 请参阅我对此问题的回答: 修改Phonegap和Pushwoosh中的通知 I would strongly recommend using Pushwoosh tags for this (filtering on the server side). However if you need to do filtering client side - see my answer to this question: Mo ...
-
一切都在5.0.6和6.2之间变化。 请注意,即使6.2是旧的,因为没有7.1。 你真的应该升级。 您可以在知识中心阅读6.2的新内容部分(我建议您阅读6.1和6.0的内容): http : //www-01.ibm.com/support/knowledgecenter/SSNJXP/welcome.html 更具体地说,您在该代码段中初始化应用程序的方式是错误的 。 请在Worklight Studio 6.2中创建一个新项目和应用程序,并查看项目结构及其工作方式。 最简单的方法是确保Remote No ...
-
看看Python龙卷风http://www.tornadoweb.org/ 。 它实际上是一个非阻塞的Web服务器,并且您有一个WebSocketHandler对象,它可能对您想要执行的操作非常有用。 http://www.tornadoweb.org/en/stable/websocket.html 问候 have a look on Python tornado http://www.tornadoweb.org/. It is in fact a non-blocking webserver and ...
-
从客户端推送通知(Push Notification from client)[2023-08-18]
在你的代码中 pushQuery.whereNotEqualTo("user", ParseUser.getCurrentUser()); pushQuery.whereEqualTo("user", ParseUser.getCurrentUser()); 这两行是不兼容的,你应该删除“whereEqualTo”行。 您可以做的另一件事是回调: ... public void done(ParseException e){ if(e!=null) ...