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.

SCORE ID COMPANYNAME<br />

1 2 <strong>SAP</strong> Aktiengesellschaft<br />

0.95 1 <strong>SAP</strong> AG<br />

Query 4: User input with two stopwords. Database records with one matching stopword.<br />

SELECT TO_DECIMAL(SCORE(), 3, 2) AS score, *<br />

FROM companies<br />

WHERE CONTAINS (companyname, 'sap ag aktiengesellschaft', FUZZY(0.8,<br />

'stopwordTable=stopwords, stopwordListId=01, textSearch=compare'))<br />

ORDER BY score DESC, ID;<br />

SCORE ID COMPANYNAME<br />

0.97 1 <strong>SAP</strong> AG<br />

0.97 2 <strong>SAP</strong> Aktiengesellschaft<br />

Stopwords Combined With Term Mappings<br />

When stopwords and term mappings are combined in a single query, term mappings are applied first. Stopwords<br />

are then applied to all variations of the search term created by the term mappings.<br />

Example<br />

Let us assume that you have defined the following term mapping:<br />

Term 1 Term 2<br />

Incredible Busy Machines IBM<br />

Ltd Limited<br />

Now you search for "Incredible Busy Machines Ltd".<br />

The search would be carried out for all possible search terms:<br />

Search Terms<br />

Incredible Busy Machines Ltd<br />

Incredible Busy Machines Limited<br />

IBM Ltd<br />

IBM Limited<br />

Let us assume that you have defined the following stopwords:<br />

Stopword<br />

busy machines<br />

294<br />

P U B L I C<br />

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

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

Enabling Search

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

Saved successfully!

Ooh no, something went wrong!