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.

TEXT and SHORTTEXT<br />

TEXT and SHORTTEXT columns offer the option 'FUZZY SEARCH INDEX' to enable and disable the additional data<br />

structures.<br />

When creating a table:<br />

CREATE COLUMN TABLE mytable<br />

(<br />

id INTEGER PRIMARY KEY,<br />

col1 TEXT FUZZY SEARCH INDEX ON FAST PREPROCESS ON,<br />

col2 SHORTTEXT(100) FUZZY SEARCH INDEX ON<br />

);<br />

Full-Text Index<br />

A full-text index offers the option 'FUZZY SEARCH INDEX' to enable and disable the additional data structures.<br />

When creating a full-text index:<br />

CREATE COLUMN TABLE mytable<br />

(<br />

col1 NVARCHAR(2000)<br />

);<br />

CREATE FULLTEXT INDEX myindex ON mytable(col1)<br />

FUZZY SEARCH INDEX ON<br />

FAST PREPROCESS ON;<br />

This can be changed at a later point in time by using the ALTER FULLTEXT INDEX command:<br />

ALTER FULLTEXT INDEX myindex FUZZY SEARCH INDEX OFF;<br />

VARCHAR and NVARCHAR<br />

VARCHAR and NVARCHAR columns also offer the option 'FUZZY SEARCH INDEX' to enable and disable the<br />

additional data structures.<br />

When creating a table:<br />

CREATE COLUMN TABLE mytable<br />

(<br />

id INTEGER PRIMARY KEY,<br />

col1 VARCHAR(100) FUZZY SEARCH INDEX ON,<br />

col2 NVARCHAR(100) FUZZY SEARCH INDEX ON<br />

);<br />

Additional performance improvements are possible when creating database indexes on the columns.<br />

CREATE INDEX myindex1 ON mytable(col1);<br />

CREATE INDEX myindex2 ON mytable(col2);<br />

The state of the fuzzy search index can be changed at a later point in time by using the ALTER TABLE statement.<br />

ALTER TABLE mytable ALTER<br />

(<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. 269

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

Saved successfully!

Ooh no, something went wrong!