This section gives a quick description of the data model concepts you must know to create a Search Application and a simple example of data model class creation.
This section gives you the basics to understand how the Data Model works.
The Data Model defines how documents are stored in the Exalead CloudView index. It provides a way to map the relevant document metas available in your corpus to specific properties grouped by classes. The data model defines how data will be stored in the index, and how it will be used at search time.
The Data Model defines how items are stored in the Exalead CloudView index. It provides a way to gather the related metas found in your data sources into specific classes.
Classes allow you to group list of properties to clearly structure your data model according to the types of documents present in your corpus. You can consider them as business logic views. A document can belong to one class only.
Properties define the configuration of the document metas you want to index. During indexing, Exalead CloudView converts properties into index fields, and optionally hit display fields or facets, depending on your configuration.
Figure 4. Transformation of document metas into index fields via the data model
Exalead CloudView installs with a default_model data model containing a default document class but you can create your own data models and classes.
Configuring Data Model Properties
This section explains the options available when defining Data Model properties.
Choose a Data Type
First configure the type of each document meta you want to index.
For example, if the document meta contains:
• Textual values, select alphanum.
• Dates, select Date (with time) or Date (without time).
• Numerical values, select Integer, Double or Unsigned Integer.
• Geographical coordinates, select GPS point or XY point.
Assign Semantic Types to Alphanumeric Properties
When adding a new alphanumeric property, you must assign it a semantic type. It defines the global semantic processing to apply when indexing document metas. If required, you can then customize this semantic processing at the Analysis pipeline level (Index > Data Processing > Semantic Processors).
Exalead CloudView includes default semantic types, but you can modify them or create additional ones in Data Model > Semantic Types.
Default Semantic Types
Semantic type
Description
text
Apply this semantic type to document metas containing several words or sentences.
For example, you would apply this semantic type for a meta with a value like:
“Deep Blue was a chess-playing computer. It is known for being the first piece of artificial intelligence to win both a chess game and a chess match against a reigning world champion under regular time controls.”
Also use this semantic type to perform extra processing treatment in the analysis pipeline.
metadata
Apply this semantic type to document metas containing a few words that do not require language detection and spell-checking.
For example, if we have the meta value Deep Blue
Searching for deep blue in lowercase would work, as well as searching for deep only or for blue only.
identifier
Apply this semantic type to document metas containing IDs.
With this semantic type, document metas will be searched in their normalized forms, but they will not be tokenized and the language will not be detected.
For example, if we have the meta value Deep Blue
Searching for “deep blue” (with quotes) would work, but searching for deep only or blue only would not work.
url
Apply this semantic type to document metas containing web addresses.
Indexing Options for Data Model Properties
When creating a data model property, you must specify whether it will be either an index field or a facet, or both.
• Dedicated field: saves the meta as a dedicated field in the index, similar to a database field.
• Category facet: saves the meta in specific index field called categories, used by facets.
This section explains the options available depending on the property type. It can be globally represented by the following schema.
Figure 5. Indexing options for data model properties
Properties have the following options:
• Searchable with prefix: allows users to search for matches in this particular meta, using a prefix. For example, to search for “API” in the title of a document, enter the search query title:API.
• Searchable without prefix: allows users to perform a simple text search, without using a prefix. For example, to search for “API” in a document, enter the search query API.
• Retrievable: enables this meta to be displayed in the hit content of search results.
• RAM based: stores this meta in RAM. Use this option if you need to sort search results on this meta, or when using this meta as a virtual facet.
Note: Property options may impact performance. For more details, see "How property options impact performance" in the Exalead CloudView Configuration Guide.
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.
Tutorial: Add a New Class
1. In the Administration Console, select Index > Data Model.
2. In the Classes panel, click Add class:
a. Name it sales
b. Select no parent class
c. 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:
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.