Quantcast
Viewing all articles
Browse latest Browse all 8968

Re: how to rank two columns using contains in Select statemen

Hi Ramesh,

 

The 1 as source and 2 as source is only constant values to you use in ORDER BY stantment later (you requested to have these selection prior than others).

 

About the fuzzy, yes there's some kind of weight you can adjust and this seems to be a more elegant way to achieve the result. I'm not sure now (need to check it out testing) but some results of text search can only be achieved with full-text index. The overhead is memory, of course, and the indexing of texts which can be made in parallel.

 

Like this (unfortunatelly I don't have proper model thiking in text search), but here you have the chance to use the WEIGHT you want for each column. That's probably what you are looking for:

SELECT "BUKRS", "BRANCH", "NAME", score() AS RELEVANCE

FROM "_SYS_BIC"."tmf.erp/AT_BRANCH"

where contains((bukrs,name),'filial',fuzzy(0.2),WEIGHT(0.9,0.1))

 

Adjust the fuzzy and weight, here I borrow the suggestions from Analytic search properties that Lars exposed:

Image may be NSFW.
Clik here to view.
fuzzy.png

 

Some references to you go deeper:

http://help.sap.com/hana/html/_dsql_predicates.html#sql_predicates_contains_predicate

http://scn.sap.com/community/developer-center/hana/blog/2012/10/10/the-not-so-fuzzy-fuzzy-search

http://scn.sap.com/community/developer-center/cloud-platform/blog/2013/05/23/enable-hana-search-in-your-cloud-application

 

Regards, Fernando Da Rós

 

Message was edited by: Fernando Ros


Viewing all articles
Browse latest Browse all 8968

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>