The Box Scanner component performs full and incremental scans over a Box repository, maintaining a stream position value that it is used to get all the events (update, add or delete) that happened slightly before to that stream position, up to the current stream_position. Updated content is then submitted to the configured pipeline in AspireObjects attached to Jobs. As well as the URL of the changed item, the AspireObject will also contain metadata extracted from the repository. Updated content is split into three types -add, update and delete-. Each type of content is published as a different event so that it may be handled by different Aspire pipelines.

The scanner reacts to an incoming job. This job may instruct the scanner to startstoppause orresume. Typically the start job will contain all information required by the job to perform the crawl. However, the scanner can be configured with default values via application.xml file. When pausing or stopping, the scanner will wait until all the jobs it published have completed before completing itself.

Box Scanner
Factory Namecom.searchtechnologies.aspire:aspire-box-scanner
InputsAspireObject from a content source submitter holding all the information required for a crawl
OutputsJobs from the crawl

Input Job Parameters

The scanner recognizes the following parameters on the control Job:

ElementTypeDescription
idintThe database id from the aspire_content_sources table.
@crawlIdintThe crawl id from the content database.
@actionStringThe control job action - startstoppause or resume.
@actionPropertiesStringProperties for the crawl - full or incremental.
connectorSource/displayNameStringThe name of the crawl.
connectorSource/ServerStringThe URL to Box Server.
connectorSource/ServerApiStringThe URL to Box API
connectorSource/ApiVersionStringThe version of the Box API
connectorSource/ClientIdstringThe client id of an app in Box.com with access to the Box account.
connectorSource/ClientSecretstringThe Client Secret of an app in Box.com with access to the Box account.
connectorSource/RedirectUrlstringThe a valid URL to redirect the authorization tokens (for authorization process)
connectorSource/UserStringLogin of the Box account.
connectorSource/PasswordstringPassword for Box accound.
connectorSource/PageSizeintegerIndicates the amount of documents or folders that will be returned by the API each call.
connectorSource/excludeExtensionsstringIndicates the list of extensions (separeted by comma) you don't want to extract the text, for instance dll or exe.
connectorSource/useImpersonatebooleanImpersonate each user of Box account in order to crawl all shared and private content. If unchecked, only shared content accessible by the crawling account will be crawled.
connectorSource/indexContainersbooleanIndicates if folders (as well as files) should be indexed.
connectorSource/scanRecursivelybooleanIndicates if subfolders should be scan.
connectorSource/ExcludeSubFolders/includestringOptional. A list of folders that can be excluded from the crawling.
connectorSource/fileNamePatterns/includeregexOptional. A regular expression pattern to evaluate file urls against; if the file name matches the pattern, the file is included by the scanner. Multiple include nodes can be added.
connectorSource/fileNamePatterns/excluderegexOptional. A regular expression pattern to evaluate file urls against; if the file name matches the pattern, the file is excluded by the scanner. Multiple exclude nodes can be added.
connectorSource/indexContainersbooleanIndicates if folders (as well as files) should be indexed..
connectorSource/scanRecursivelybooleanIndicates if subfolders of the given URL should be scanned.


Configuration

The scanner recognizes the following configuration parameters:

ElementTypeDefaultDescription
Serverstringhttps://app.box.comThe Box server Url.
Server API Urlstringhttps://api.box.comURL for Box API.
API versionstring2.0The API version that Box is using.
Client IdstringnoneThe client id of an app in Box.com with access to the Box account.
Client SecretstringnoneThe Client Secret of an app in Box.com with access to the Box account.
Redirect Urlstringhttps://localhost:4000The a valid URL to redirect the authorization tokens (for authorization process)
UserStringnoneLogin of the Box account.
PasswordstringnonePassword for Box account.
PageSizeinteger100Indicates the amount of documents or folders that will be returned by the API each call.
ExcludeExtensionsstringnoneIndicates the list of extensions (separeted by comma) you don't want to extract the text, for instance dll or exe.
useImpersonatebooleanfalseImpersonate each user of Box account in order to crawl all shared and private content. If unchecked, only shared content accessible by the crawling account will be crawled.
ExcludeSubFolders/includestringnoneOptional. A list of folders that can be excluded from the crawling.
fileNamePatterns/includeregexnoneOptional. A regular expression pattern to evaluate file urls against; if the file name matches the pattern, the file is included by the scanner. Multiple include nodes can be added.
fileNamePatterns/excluderegexnoneOptional. A regular expression pattern to evaluate file urls against; if the file name matches the pattern, the file is excluded by the scanner. Multiple exclude nodes can be add
indexContainersbooleanfalseIndicates if folders (as well as files) should be indexed..
scanRecursivelybooleanfalseIndicates if subfolders of the given URL should be scanned..


Branch configuration

This component publishes to the onAddonDelete and onUpdate, so a branch must be configured for each of these three events.

ElementTypeDescription
branches/branch/@eventstringThe event to configure - onAddonDelete or onUpdate.
branches/branch/@pipelineManagerstringThe name of the pipeline manager to publish to. Can be relative.
branches/branch/@pipelinestringThe name of the pipeline to publish to. If missing, publishes to the default pipeline for the pipeline manager.


Configuration 

Configuration
 <component name="Scanner" subType="scanner"
          factoryName="aspire-box-scanner">
          <debug>${debug}</debug>
          <metadataMap>
            <map from="action" to="action" />
            <map from="doc-type" to="docType" />
            <map from="last-modified-date" to="lastModified" />
            <map from="content-length-bytes" to="dataSize" />
            <map from="owner" to="owner" />
          </metadataMap>
          <snapshotDir>${snapshotDir}</snapshotDir>
          <enableAuditing>${enableAuditing}</enableAuditing>
          <fileNamePatterns>
            <include pattern=".*" />
            <exclude pattern=".*tmp$" />
          </fileNamePatterns>
          <emitCrawlStartJobs>${emitStartJob}</emitCrawlStartJobs>
          <emitCrawlEndJobs>${emitEndJob}</emitCrawlEndJobs>
          <!-- Group cache -->
          <geCache lowercase="${geLowerCase}">
            <domain strip="${geStripDomain}" add="${geAddDomain}"/>
          </geCache>
          <branches>
            <branch event="onAdd" pipelineManager="../ProcessPipelineManager"
              pipeline="addUpdatePipeline" allowRemote="true" batching="true"
              batchSize="50" batchTimeout="60000" simultaneousBatches="2" />
            <branch event="onUpdate" pipelineManager="../ProcessPipelineManager"
              pipeline="addUpdatePipeline" allowRemote="true" batching="true"
              batchSize="50" batchTimeout="60000" simultaneousBatches="2" />
            <branch event="onDelete" pipelineManager="../ProcessPipelineManager"
              pipeline="deletePipeline" allowRemote="true" batching="true"
              batchSize="50" batchTimeout="60000" simultaneousBatches="2" />
            <branch event="onCrawlStart" pipelineManager="../ProcessPipelineManager"
              pipeline="crawlStartEndPipeline" allowRemote="true"/>
            <branch event="onCrawlEnd" pipelineManager="../ProcessPipelineManager"
              pipeline="crawlStartEndPipeline" allowRemote="true"/>
          </branches>
        </component>


Scanner Control Configuration

The following table describes the list of attributes that the AspireObject of the incoming scanner job requires to correctly execute and control the flow of a scan process.

ElementTypeOptionsDescription
@actionstringstart, stop, pause, resume, abortControl command to tell the scanner which operation to perform. Use start option to launch a new crawl.
@actionPropertiesstringfull, incrementalWhen a start @action is received, it will tell the scanner to either run a full or an incrementalcrawl.
@normalizedCSNamestring Unique identifier name for the content source that will be crawled.
displayNamestring Display or friendly name for the content source that will be crawled.


Header Example

Header
  <doc action="start" actionProperties="full" actionType="manual" crawlId="0" dbId="0" jobNumber="0" normalizedCSName="FeedOne_Connector"
   scheduleId="0" scheduler="##AspireSystemScheduler##" sourceName="ContentSourceName">
    ...
    <displayName>testSource</displayName>
    ...
  </doc>




  • No labels