cancel
Showing results for 
Search instead for 
Did you mean: 

MDM Java API: searches on multiple fields ,Query problem.

Former Member
0 Kudos

Dear All,

I want to do a search on muliple fields in the MDM 'Products' table.The scenario may be like this:

FIND(Description,"dummytext") AND

FIND(Category,"dummycategoryname") AND

(FIND(Manufacturer,"dummymanufacturername") OR

FIND(Name,"dummyname"))

The problem is the inner query.How do i change the behaviour to 'OR' type.

I am using :

Search search = new Search("Products");

search.SetSearchType(Search.GlobalOrSearchCombinationType);

However this changes the default behaviour of the search object for the whole query.I want it to be limited to the inner query only.

I'll appreciate any help.

Thanks,

Karambir Singh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Perhaps you could perform the first search and add the results into a mask. Latter on, perform the second query limited by the mask you created.

That way I suppose you could simulate inner queries, which I believe is not naturally possible on MDM

If you need further information please don't hesitate to ask

Kind Regards

Alejandro

Former Member
0 Kudos

Thanks Alejandro for the reply,

I've never with a mask.However,i'll definitely explore this option.If you have any code snippets for the same , please share the same.

Former Member
0 Kudos

Hi,

Please check this <a href="/people/sap.user72/blog/2006/05/01/use-mdm4j-to-automatically-update-a-mask for updating records in a Mask with Java API. You can also check this <a href="/people/sap.user72/blog/2005/08/29/brief-introduction-to-masks-in-mdm-55 if you are looking for info on "How to create and Add records to a mask".

Hope this helps,

Regards,

Rajani Kumar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Karambir Singh,

What you are describing is possible if the OR is for the same field(see description below). In your example, the OR is on different fields (Manufacturer and Name) so it isn't possible.

The FreeFormParameterField class has a search operator that you can set to AND or OR. This allows you to search for Name="dummyname1" OR Name="dummyname2". And you can combine this in an AND search using Search.SetSearchType to other search criteria

Hope this helps,

Richard