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.

Limitations<br />

The SNIPPET function has the following limitations:<br />

● Only the first search term specified with the CONTAINS predicate is highlighted in the returned text.<br />

● The query result contains only the first hit of the first search term.<br />

● The text excerpt that is displayed with the search term is limited to a string of 12 tokens.<br />

● This function only works on columns of the TEXT data type or columns with a full text index.<br />

HIGHLIGHTED Function<br />

For search queries using the CONTAINS predicate, you can use the function HIGHLIGHTED to return the<br />

content of the found document with your search term highlighted in bold.<br />

Search queries using the HIGHLIGHTED function return the data type NCLOB.<br />

This function uses the following syntax:<br />

SELECT *, HIGHLIGHTED () FROM <br />

WHERE CONTAINS ()<br />

Limitations<br />

The HIGHLIGHTED function has the following limitations:<br />

● Only the first search term specified with the CONTAINS predicate is highlighted in the returned text.<br />

● The query result contains all hits of the first search term.<br />

● This function only works on columns of the TEXT data type or columns with a full text index.<br />

SCORE Function<br />

For search queries using the CONTAINS predicate, you can use the function SCORE to get the score, that means<br />

the relevance, of a record found.<br />

<strong>SAP</strong> <strong>HANA</strong> calculates a score based on the following information:<br />

● The relevance or weighting of attributes in a search using the CONTAINS predicate. The relevance of a hit<br />

depends on the weight of the column that caused the hit. You can specify weights when you create the view or<br />

in the CONTAINS predicate.<br />

● Fuzziness in fuzzy search. The more exact a hit is, the higher the score is.<br />

● Text ranking (TF-IDF).<br />

This function uses the following syntax:<br />

SELECT SCORE (),* FROM <br />

WHERE CONTAINS ()<br />

11.2.2 EXACT Search<br />

An exact search returns records only if the search term or search phrase is contained in the table column exactly<br />

as specified. In the SELECT statement of the search query, you can specify the EXACT search type.<br />

In an exact search, the search engine uses the word dictionary and the phrase index to detect the possible<br />

matches. The search engine then checks whether the words appear and use exactly the same spelling.<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. 255

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

Saved successfully!

Ooh no, something went wrong!