简体   繁体   English

如何在单独的搜索链中使用 vespa.ai 中的多个文档处理器?

[英]How to use multiple document processor in vespa.ai in separate search chain?

I need to use multiple document processor in my vespa use case.我需要在我的 vespa 用例中使用多个文档处理器。 I have a condition where I need to modify feeds based on different conditions.我有一个条件,我需要根据不同的条件修改提要。 I can not use document processor chaining.我不能使用文档处理器链接。 It has to be a separate one which I can use every time I insert a feed.它必须是一个单独的,我每次插入提要时都可以使用它。 I have tried using the below server.xml configuration.我尝试使用以下 server.xml 配置。


    <document-processing>
                <chain id="foo">
                    <documentprocessor
                        id="com.abc.xyz.Test" bundle="abc-xyz-one" />
                </chain>
    <chain id="bar">
                    <documentprocessor
                        id="com.abc.xyz.Test2" bundle="abc-xyz-one" />
                </chain>
    </document-processing>

Request http://<IP>:<port>/document/v1/test2/test2/docid/<id>/;&chain=foo请求http://<IP>:<port>/document/v1/test2/test2/docid/<id>/;&chain=foo

Here I am getting a timeout.在这里,我超时了。

To add multiple document processors, use要添加多个文档处理器,请使用

<document-processing>
  <chain id="default">
    <documentprocessor id="com.abc.xyz.Test" bundle="abc-xyz-one" />
    <documentprocessor id="com.abc.xyz.Test2" bundle="abc-xyz-one" />
  </chain>
</document-processing>

(I don't think you want to here but if you need multiple chains, you need to configure routing. This is because you usually want to route to processing chains depending on operation attributes, not leave it up to clients.) (我不认为你想在这里,但如果你需要多个链,你需要配置路由。这是因为你通常希望根据操作属性路由到处理链,而不是留给客户端。)

The /document/v1 http api (described here https://docs.vespa.ai/documentation/document-api.html ) does not support a chain parameter. /document/v1 http api(在此处描述https://docs.vespa.ai/documentation/document-api.html )不支持链参数。 It has a 'route' parameter which allows you to send messages through a route where hops along the route can be docproc chains.它有一个“路由”参数,它允许您通过路由发送消息,其中沿路由的跃点可以是 docproc 链。

It'a unclear what you really want to do but you can route document operations to different document processing chain by having a route per chain (Then the condition which route to sent to needs to be resolved outside of Vespa), see https://docs.vespa.ai/documentation/routing.html .不清楚您真正想要做什么,但您可以通过为每个链设置一个路由来将文档操作路由到不同的文档处理链(然后需要在 Vespa 之外解析发送到的路由的条件),请参阅https:// docs.vespa.ai/documentation/routing.html The vespa-route command utility is very handy to figure out what the hop names are. vespa-route 命令实用程序对于找出跃点名称非常方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM