cancel
Showing results for 
Search instead for 
Did you mean: 

trex attribute based search

Former Member
0 Kudos

Hi, i need some help regarding attribute based search with SES.

Scenario u2013

In attribute search, I want to search for string u201Ctest one twou201D in two attributes, say field1 and field2. The result should be all entries that contain any combination of words u201Ctestu201D u201Coneu201D u201Ctwou201D, in the attributes field1 or field2.

Example:

Field1 u2013 test one

Field2 u2013 two

Field1 u2013 test one two

Field2 u2013 test

Field1 u2013 test

Field2 - one

The search query should return all these entries. How do I create this query for attribute based search?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Hitesh,

at first you should consider using the full text search feature.

The only "restriction" for you will be that it searches in all other attributes as well.

As test frames you can use the standard reports COM_SE_SEARCH_TEST and COM_SE_SEARCH_IIF_TEST

If a full text search fulfills your requirements, you are done.

If you insist on your attribute search approach, start reading SAP note 1254901. It contains a link to the developer's guide. There you find some information how to create an F4 help.

More information on F4 can be found in the SES FAQ note 1345777.

Even if you don't need the F4 for your project, it will serve you as a comfortable test frame.

For more, you can visualize the TREX query syntax by debugging the standard search API below: CL_COM_SE_SEARCH_IIF=>SEARCH_OBJECTS for parameter IT_QUERY_ENTRIES

There you will see, how brackets are used.

If you try to type your query into your F4 help you will see a query like (simplified notation):

(field1 = test or field1 = one or field1 = two) and (field2 = test or field2 = one or field2 = two)

So F4 cannot be used for your actual requirement, because you need an "or" in the middle instead of the "and". But once you understood the TREX query syntax notation, you will be able to express, what you need.

Kind regards, Klaus

Former Member
0 Kudos

Hi Klaus,

i've read all the material, and i know how to form queries for attribute-based search. I know the full text search will make it much easier but my requirement is to use the attribute-based search.

For my scenario, i can form 8 individual query entries that will cover all combinations of the words "test" "one" and "two" and combine them with 'OR' and that will return the desired results. But what i was looking for was 1 query that will cover all combinations of the words.

Because in this case there are only 3 words, and i know how many words there are, i know how many queries to form, but mostly i wont know how many words are being entered, and there may be 10 words entered, in which case the number of query entries increases.

Thats why i was hoping there would be a way in which i can form only 1 query that says "look for all combinations of these words in these attributes".

0 Kudos

Hi Hitesh,

in my terminology "1 query" is 1 TREX call. Still the 1 query might be rather complex, i.e. it may have multiple lines in the interface table IT_QUERY_ENTRIES

In this way it should be possible.

Kind regards, Klaus

Former Member
0 Kudos

By "1 query" i mean 1 line in the interface table IT_QUERY_ENTRIES.

For my example i can get the results by forming 8 queries, that means by adding 8 lines to the table IT_QUERY_ENTRIES, but i wanted to do it in just 1 query, that means by adding only 1 line to the internal table IT_QUERY_ENTRIES.

Is that possible for this scenario ?

0 Kudos

Hi Hitesh,

no, I don't think so.

Kind regards, Klaus

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am doing an attribute search in SES - TREX.

My requirement is attribute 1 = Sid

attribute 2 = My

If the user search for attribute1 = Sid amd attribute 2 = My , the search returns all the values with attribute 1 = Sid and attribute 2 = My with a union and intersection providing the ranking that if both the value match , the ranking is 100% else it is 50%.

Is that achievable through TREX.

Best Regards

Sid

Former Member
0 Kudos

Hi, when performing a search, the ranking is returned along with the search results. The structure com_search_ts_result_item has a field rank_value which stores the ranking

Former Member
0 Kudos

Hi Hitesh,

Let me explain you my requirement.

I am doing a freestyle search on a set of attributes for a business object(SES Search).

Now, if I type in the search box ZClterm*

I shall get ZCLTERM return as 100% Ranking

Z* Return as franction of ranking

cl* return as franction of ranking

ZCL* as one fraction of ranking

Is that achiveable. Or is there any way or a custom algorithm to achieve the same.

Best Regards

Sid

Former Member
0 Kudos

i dont think thats achievable, because there's no way of finding out which combination of words fetched the results ... Can you tell me how are you performing free style search ?