Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29503

Elasticsearch.BulkIndex should work in Multi-repository

    XMLWordPrintable

    Details

      Description

      Context

      When running in multi-repositories it makes sense to be able to start the bulk-reindex of one repository.

      By passing the right repository argument, we could expect the code to behave as needed:

      curl -H 'Content-Type:application/json+nxrequest' -H 'X-NXRepository:us-west' -X POST -d '{"params":{},"context":{}}' -u nco-admin:fsdfwfqDFER34d http://127.0.0.1:8080/nuxeo/api/v1/automation/Elasticsearch.BulkIndex
      

      Issue with the current code

      The current code is "half right":

      When we delete the index we take into account the repository:

       esa.dropAndInitRepositoryIndex(session.getRepositoryName(), false);
      

      However, when we create the BulkCommand we do not set the repository

            return bulkService.submit(
                      new BulkCommand.Builder(ACTION_NAME, nxql, username).param(INDEX_UPDATE_ALIAS_PARAM, syncAlias)
                                                                          .build());
      

      As a result, the indexing command will fail or not do what is needed: in my case, I wanted to reindex repository us-east and what it actually did is:

      • delete the index for us-east
      • try to reindex the default repository that is empty in my case
      Invalid query results in an empty document set: org.nuxeo.ecm.core.bulk.message.BulkCommand@100264c3[id=a167973b-3983-4e59-b558-1b9df497895d,action=index,query=SELECT ecm:uuid FROM Document,username=nco-admin,repository=default,bucketSize=1000,batchSize=50,scroller=<null>,genericScroller=false,params={updateAlias=true}]
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h