-1

I have my custom Searcher and my custom DocumenetProcessor in my vespa app.My service.xml is given below:

<services version="1.0">

  <container id="default" version="1.0">
    <document-api/>
    <search>
      <chain id="default" inherits="vespa">
        <searcher id="com.example.test.CustomSearcher" bundle="example-vespa-app"/>
      </chain>
    </search>
    <nodes>
      <node hostalias="node1" />
    </nodes>
    <document-processing>
      <chain id="default" inherits="vespa">
        <documentprocessor id="com.example.test.CustomDocumentProcessor"/>
      </chain>
    </document-processing>
  </container>


  <content id="test_user" version="1.0">
    <redundancy>1</redundancy>
    <documents>
      .....
  </documents>
    <nodes>
      <node hostalias="node1" distribution-key="0" />
    </nodes>
  </content>
</services>

My CustomDocumentProcessor is given below:

public class CustomDocumentProcessor  extends DocumentProcessor {

    @Override
    public Progress process(Processing processing) {
        for (DocumentOperation op : processing.getDocumentOperations()) {
            if (op instanceof DocumentPut) {
                DocumentPut put = (DocumentPut) op;
                Document document = put.getDocument();
                document.setFieldValue("documentType", 
                 String.valueOf(document.getDataType()));
            }
        }
        return Progress.DONE;
    }

}

When I remove CustomDocumentProcessor from service.xml, my app works .When I add it , It gives an error:

Request failed. HTTP status code: 400 Invalid application package: default.default: Error loading model: Missing chain 'vespa'.

Why is that? Please help.

Mohammad Sunny
  • 371
  • 1
  • 3
  • 15

1 Answers1

2

Remove "inherits=vespa" from the document-processing chain.

There is no "vespa document processing chain like there is for search chains.

Jon
  • 2,043
  • 11
  • 9
  • After removing "inherits=vespa", I got this error. ERROR : container Container.com.yahoo.jdisc.core.StandaloneMain JDisc exiting: Throwable caught: \nexception=\njava.lang.IllegalArgumentException: Could not create a component with id 'com.example.test.CustomDocumentProcessor'. Tried to load class directly, since no bundle was found for spec: com.example.test.CustomDocumentProcessor. If a bundle with the same name is installed, there is a either a version mismatch or the installed bundle's version contains a qualifier string. – Mohammad Sunny Nov 21 '18 at 10:39
  • Any other solution please!! – Mohammad Sunny Nov 22 '18 at 06:18
  • You're missing the bundle attribute. – Jon Nov 22 '18 at 11:08