Cancel
Showing results for 
Search instead for 
Did you mean: 

Custom AND Query

Experimenter
Experimenter

Hi,

 

I want to search Item Name which conatin 2 words in any order.

e.g. "ABC" and "XYZ" should return results:

-ABC PLATE XYZ BRACKET

-XYZ PLATE ABC ANGLE

 

Can we search like this using any wildcards? OR do we need to create custom query and how? I tried creating query as attched but it does not working as it should. Any ideas?

 

Regards,

 

 

6 REPLIES 6

Re: Custom AND Query

Valued Contributor
Valued Contributor

@SRW You can't have same field labels. Rename them to "ItemName1" and "ItemName2" and try *ABC* and *XYZ* as shown in the attachment.

Re: Custom AND Query

Experimenter
Experimenter

Thank you Santosh, It is working now! Great!

Re: Custom AND Query

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

You may not need to repeat the search field i.e. object_name. In the same line search criteria you can enter the required search parameter values using semicolon ( ; ) for ex.  in your case it should be      *ABC*XYZ*;*XYZ*ABC*.

 

Semicolon is the default separator and can be changed using a preference WSOM_find_list_separator

Re: Custom AND Query

Valued Contributor
Valued Contributor

@Amol_XPLM...Yes that works too. However, its not very intuitive to users. We have a similar query set up for Item Description and based on the feedback from our user community, we had to introduce multiple entry fields Keyword1, Keyword2, Keyword3 etc... I agree with your approach if admin is the only consumer of this query.

Highlighted

Re: Custom AND Query

Experimenter
Experimenter

@Amol_XPLM Yes that is an option, but as @SantoshMurthy said users prefer to have seperarte entry fields which is much easier for them. 

 

Now I have manged to get the query working. Still we need to put asterisk (*) at begining and end of the word (e.g. *XYZ*). I tried setting CONTAINS in query design but it does not work. Any idea?

 

I am newbie to this admin settings so might be asking silly questions. 

Re: Custom AND Query

Solution Partner Legend Solution Partner Legend
Solution Partner Legend
@SantoshMurthy Agreed with you. However, the advantage of using separator based query is that in case you have to modifiy the query in case you want to search using multiple criteria (like ABC, PQR, LMN, XYZ) in future. So this option can be suitable in situations where flexibility of search criteria is needed.