Create a New Class in the Data Model

We want to configure the data model required to index the database fields. To do so, we will first create a new data model class.

This task shows you how to:

Tutorial: Add a New Class

  1. In the Administration Console, select Index > Data Model.
  2. In the Classes panel, click Add class:
    1. Name it sales
    2. Select no parent class
    3. Click Accept

Tutorial: Add Properties to the New Class

Once the class is created, we must configure a set of properties to map document metas to index fields and facets. To help us configuring these properties, we will use the Trace all metas option, which retrieves the list of metadata associated with the connector’s documents.

  1. In the Classes panel, select Trace all metas and click Apply.
  2. Go to the Home page, click Scan for the salesdb connector.

    Once done, 15,000 documents are indexed.

  3. Go back to Index > Data Model > Classes.
  4. Select the sales class and click Add properties from traced metas.
  5. Select the metas to be generated as properties and change their types according to the table below:

    Table 1. Details for the sales class properties configuration

    Name

    Data Type

    Semantic Type

    Field Type

    category

    Alphanum

    metadata

    Category facet

    color

    Alphanum

    metadata

    Category facet

    description

    Alphanum

    text

    Dedicated field

    firstname

    Alphanum

    text

    Dedicated field

    id

    Alphanum

    metadata

    Dedicated field

    lastname

    Alphanum

    text

    Dedicated field

    name

    Alphanum

    text

    Dedicated field

    quantity

    Integer

    n/a

    Dedicated field

    store_city

    Alphanum

    metadata

    Category facet

    store_country

    Alphanum

    metadata

    Category facet

    unit_price

    Double

    n/a

    Dedicated field

    Set your properties as follows:

  6. Click Generate properties.

    The new properties appear for the sales class.

  7. You must edit the properties as detailed below.

    Property

    Data Type

    Option to add

    description

    Alphanum

    Searchable without prefix

    name

    Alphanum

    Searchable without prefix

  8. Clear the Trace all metas option.
  9. Click Apply.

Tutorial: Re-Index Data Using the New sales Class

To map document metas to the sales class properties, we need to clear what has been indexed previously and reindex data.

  1. On the Home page, click Clear documents for the salesdb connector.
  2. Click Accept to confirm.

    Wait for the index to clear its documents.

  3. Click Scan for the salesdb connector.

After a few seconds, records are pushed and Exalead CloudView processes them. Once the scan is complete, there are 15,000 indexed documents.

Tutorial: See the Search Results

Now that data has been indexed, you can check the results of what has been configured so far on the default front end.

  1. Go to the Mashup UI: http://<HOSTNAME>:<BASEPORT>/mashup-ui
  2. For our example, search for all documents by entering #all in the search field.

    The hit metas and hit facets you can see in each hit content, are displayed because the retrievable option is selected by default when you add properties.

    The orange rectangle, displays the hit metas. The blue rectangles display the metas configured as category facets and hit facets.