This tutorial walks through the steps necessary to crawl Box.com repository using the Box connector. You may wish to read through the instructions first so that you can gather up the information needed to input the crawling parameters.

Before Beginning: Admin User Account

A prerequisite for crawling Box is to have a Box account. This account should have sufficient permissions to crawl documents for indexing (Admin user). Also the account should create at least one Box application in order to get the client_id, client_secret and API Key, all necessary parameters to authenticate to Box.com server.

Step 1: Set Box Access Rights

The Box account will need to have sufficient access rights to read all of the documents in Box that you wish to crawl (Admin user)

If you are interested in crawling shared and private content for all users of Box, you will need to open a ticket to Box support providing the client id and client secret, requesting As-User functionality, this will be necessary to crawl private content for all users by impersonating each user.

See [1] section for more details.

Step 2: Install the Box Connector App into Aspire 2

To specify exactly what Box repository to crawl, we will need to create a new "Content Source".
 
Aspire 2.0 Home Page

  1. Launch Aspire (if it's not already running). See: Launching Aspire
  2. Browse to: http://localhost:50505. For details on using the Aspire Content Source Management page, please refer to UI Introduction.
  3. From the Aspire Admin page (http://localhost:50505/aspire/files/home.html), click on the "[Add Source]" button and select Box connector from the list. In case is not in the list you can add as a custom with the following configuration.

    Group Id: com.searchtechnologies.aspire
    Artifact Id: app-box-connector
    Version: 2.0.3 or 2.1


Step 2a: Specify Basic Information



General Configuration Tab

In the "General" tab in the Add New Content Source window, specify basic information for the content source:

  1. Enter a content source name in the "Name" field.

    This is any useful name which you decide is a good name for the source. It will be displayed in the content source page, in error messages, etc.

  2. Click on the "Active?" checkbox to add a checkmark.

    Unchecking the "Active?" option allows you to configure content sources but not have them enabled. This is useful if the source is unavailable.

  3. Click on the "Schedule" drop-down list and select one of the following: Manually, Periodically, Daily, Weekly or Advanced.

    This can automatically schedule content sources to be crawled on a set schedule, such as once a day, several times a week, or periodically (every N minutes or hours). For the purposes of this tutorial, you may want to select Manually and then set up a regular crawling schedule later.

  4. After selecting a Schedule type, specify the details, if applicable:

    Manually: No additional options. Periodically: Specify the "Run job every:" options by entering the number of "hours" and "minutes." Daily: Specify the "Start time:" by clicking on the hours and minutes drop-down lists and selecting options. Weekly: Specify the "Start time:" by clicking on the hours and minutes drop-down lists and selecting options, then clicking on the day checkboxes to specify days of the week to run the crawl.

Step 2b: Specify connector properties



Connector properties

Connector properties

  1. In the "Server" field in the ' Content Source Properties' section, enter the Server URL to crawl.
  2. In the "Server API" field in the ' Content Source Properties' section, enter the URL to the Box API (For version 2.0, the current url is https://api.box.com).

    Most include the respective protocol, http or https.

  3. API Version, the connector was develop and tested with version 2.0.
  4. Enter the Client ID, Client_Secret, Redirect_Url: The Box API uses OAuth 2 for authentication, so in order to connect, we need register a Box application and get these values.
  5. Enter the Username, Password of the Box.Com account (Admin account).

    Note: The password will be automatically encrypted by Aspire.

  6. Enter the page size, which indicates the amount of documents or folders that will be returned by the API each call.
  7. Exclude extension for extract text by setting the extensions (separeted by comma) you don't want to extract the text, for instance dll or exe.
  8. Check on the other options as needed:
    1. Impersonate users?: Impersonate each user in order to crawl all shared and private content.
      If unchecked, only shared content accessible by the crawling account will be crawled.
    2. Index folders?: index subfolders as items. If unchecked, only files will be indexed.
    3. Scan subfolders?: Scan through subfolder's child nodes.
    4. Exclude Sub Folders: Enter a Folder name (or a list of folders) to be exclude from the crawling.
    5. Include/Exclude patterns: Enter regex patterns to include or exclude files/folders based on URL matches.

    If you want to specify include patterns, click on the 'add new' button for include patterns and specify the regex pattern. So Aspire will only crawl URLs with the specified pattern. If you want to specify exclude patterns, click on the 'add new' button for exclude patterns and specify the regex pattern. So Aspire will exclude crawling of URLs that matches the specified pattern.

  9. Click on Advance Configuration option, verify the Box Working directory value, you will need to create Box.accesstoken and Box.refreshtoken files with the corresponding values from the previous process (Box Prerequisites) and save them into the working dir.

Step 2c: Specify Workflow Information



Aspire 2.0 Workflow Information

In the "Workflow" tab, specify the workflow steps for the jobs that come out of the crawl.

  1. Drag and drop rules to determine which steps should an item follow after being crawled. This rules could be where to publish the document or transformations needed on the data before sending it to a search engine. See Workflow for more information.

After completing this steps click on the Save button and you'll be sent back to the Home Page.

Step 3: Initiate the Full Crawl

Now that everything is set up, actually initiating the crawl is easy.

  1. From the Aspire Admin page (http://localhost:50505/aspire/files/home.html), you can see the new Box connector.
  2. Make sure connector is active and crawl type is full(click on the crawl type link if it is incremental or test until it display full).

    Content Source have crawl type options such as Full, Incremental and Test

  3. Then click on the start button and it will display a pop up to get confirmation regarding removing already indexed data. Please click on the OK button by accepting it. Initiating a Full Crawl will remove any previously-indexed information (incremental stream-position) and re-index the source from scratch.
  4. Now connector will crawl the whole Box repository (according to your configuration). It may take a minute or two for Aspire to connect to the content source and begin feeding the content.

Note that connector will be automatically initiated by the scheduler based on the schedule you specified for the connector, be it once a day, once a week, every hour, etc. But you can always start a crawl at any time by clicking on the "Start" button.

Aspire 2.0 running content source

During the Crawl

During the crawl, you can do the following:

  1. Click on the "Refresh" button on the Content Sources page to view the latest status of the crawl.

    The status will show RUNNING while the crawl is going, and CRAWLED when it is finished.

  2. Click on "Complete" link on your connector to view the number of documents crawled so far, the number of documents submitted, and the number of documents with errors.



Aspire 2.0 content source statistics

If there are errors, you will get a clickable "Error" flag that will take you to a detailed error message page.

Step 4: Initiate an Incremental Crawl

If you only want to process content updates from Box (documents which are added, modified, or removed), then click on the "Run" button when the crawl type is “incremental” link selected. The Box connector will automatically identify only changes which have occurred since the last crawl.

If this is the first time that the connector has crawled, the "incremental" link does the same thing as the "Full" link selected. Both will crawl the entire content source and submit all documents. Thereafter, if you click on “Run” button when crawl type is "incremental" it will only crawl updates.

Scheduled crawls are always "Incremental” crawls. This means that the first scheduled job will perform a "Full" crawl, and jobs after that will perform "update" crawls. Statistics are reset for every crawl.

Statistics are reset for every crawl.

Group Expansion

Group expansion configuration is done on the "Advanced Connector Properties" of the Connector tab.

  1. Click on the Advanced Configuration checkbox to enable the advanced properties section.
  2. Scroll down to Group Expansion and click the checkbox.
  3. Set the Box Server url, Server API url, API version, client credentials and other needed properties of Box repository.
  4. Set an schedule for group expansion refresh and cleanup.
  5. There is Extract Ldap Users option, the default value of ACL in Box connector would be a box user account, which is a email account (masolis@searchtechnologies.com). But if the group expansion needs to handle a Windows accounts (for example, if you are indexing in Sharepoint) instead of emails, you need to configure the LDAP server information that contains the definition of all Box accounts, then the Box group expansion would create a map between the windows account and the Box email.

Limitations

  1. Box connector crawls only the latest version of files.
  2. Box connector does not crawls any Trash items (folders or files)

Incremental limitations

  1. When there is change on a Box Note will not reflect in the incremental crawl.

Save your content source before creating or editing another one

Failing to save a content source before creating or editing another content source can result in an error.

ERROR [aspire]: Exception received attempting to get execute component command com.searchtechnologies.aspire.services.AspireException: Unable to find content source

Save the initial content source before creating or working on another.

  • No labels