28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11 Enabling Search<br />

With a <strong>SAP</strong> <strong>HANA</strong> database, your users will want to search tables and views much like they would when searching<br />

for information on the Internet. In <strong>SAP</strong> <strong>HANA</strong>, you can either directly query data using SQL queries or you can<br />

build search apps using a UI toolkit.<br />

Before enabling search, you must meet the following prerequisites:<br />

● Your <strong>SAP</strong> <strong>HANA</strong> database contains column-oriented tables.<br />

● A valid data type is assigned to each column. The data types of the columns determine how you can query<br />

your data.<br />

In <strong>SAP</strong> <strong>HANA</strong>, you can search on single or multiple columns of almost any visible data type. In addition to standard<br />

string search, <strong>SAP</strong> <strong>HANA</strong> also supports full text search.<br />

During a full text search, the <strong>SAP</strong> <strong>HANA</strong> search engine examines structured text, such as author and date<br />

attributes, as well as unstructured text, such as body text. Unlike a string search, for a text search, the sequence<br />

of words and characters is not critical for finding matches. A full text index enables this functionality by analyzing<br />

and preprocessing the available text semantically. This includes normalization, tokenization, word stemming, and<br />

parts of speech tagging.<br />

To enable search, proceed as follows:<br />

1. Create any required full text indexes for the columns in the table.<br />

○ For columns defined with the data type TEXT or SHORTTEXT(n), full text indexes are automatically<br />

generated. For columns of any other data type, you must manually create any required full text indexes.<br />

○ When you create a full text index, you can also define synchronization and trigger text analysis.<br />

2. Build SQL search queries.<br />

○ Search queries use the SQL SELECT statement.<br />

○ For searches on large object types or text, the queries must include the CONTAINS predicate.<br />

3. Optionally, build search apps using the UI toolkit for <strong>SAP</strong> <strong>HANA</strong> Info Access .<br />

○ The UI toolkit provides UI building blocks for developing browser-based search apps for end users.<br />

○ The UI toolkit is based on HTML5 and JavaScript libraries.<br />

○ The UI toolkit connects to the database using the <strong>SAP</strong> <strong>HANA</strong> Info Access service that wraps search and<br />

analytic SQL queries and exposes them through an HTTP interface.<br />

11.1 Creating Full Text Indexes<br />

When you create a TEXT or SHORTTEXT column in a table, <strong>SAP</strong> <strong>HANA</strong> automatically creates a corresponding full<br />

text index. However, for columns of other data types, you must manually create and define any necessary full text<br />

indexes.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Enabling Search<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 235

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!