You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Mith Atul <at...@gmail.com> on 2011/04/06 15:58:03 UTC

How to use LIKE operator

Can u help me use the LIKE Operator in ofbiz .
Can u give me a demo code on how to use the LIKE operator the  way
from the delegator class.
Thnks in adv .

Fwd: How to use LIKE operator

Posted by Mith Atul <at...@gmail.com>.
I am not fluent in lucene. But my req. is to retrieve data by avoiding
case sensitive text  using delegator i.e basic ENTITY.

Pl reply what can we do in context of "EntityExpr"   to avoid case sensitive
text.

---------- Forwarded message ----------
From: Erwan de FERRIERES <er...@nereide.fr>
Date: Sat, Apr 23, 2011 at 8:14 PM
Subject: Re: How to use LIKE operator
To: user@ofbiz.apache.org


you may start looking to lucene and then you can also add full text search
to
your queries.
Lucene is present in the content component.

--
View this message in context:
http://ofbiz.135035.n4.nabble.com/How-to-use-LIKE-operator-tp3430850p3470090.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: How to use LIKE operator

Posted by Erwan de FERRIERES <er...@nereide.fr>.
you may start looking to lucene and then you can also add full text search to
your queries.
Lucene is present in the content component.

--
View this message in context: http://ofbiz.135035.n4.nabble.com/How-to-use-LIKE-operator-tp3430850p3470090.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: How to use LIKE operator

Posted by Mith Atul <at...@gmail.com>.
Thnk you th eLIKE operator is working  but we have another problem  .

The LIKE operator is sorting by case sensitivity which should not happen in
our case .

How do we avoid case sensitive search in LIKE Operator.

THNK in advance.

Re: How to use LIKE operator

Posted by Nicolas Malin <ma...@librenberry.net>.
Le 06/04/2011 15:58, Mith Atul a écrit :
> Can u help me use the LIKE Operator in ofbiz .
> Can u give me a demo code on how to use the LIKE operator the  way
> from the delegator class.
> Thnks in adv .
in value you use % :
ex :
  * "%a%" search value contains a
  * " %a" serach value end with a
  * "a%" search vallue start with a

Nicolas

-- 
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/


Re: How to use LIKE operator

Posted by Rishi Solanki <ri...@gmail.com>.
Atul,
If you want case sensitivity then directly pass the string to the method.
In case you do not want then use EntityFunction.UPPER and pass the string in
upper case.

HTH!

Rishi Solanki
Manager, Enterprise Software Development
HotWax Media Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxmedia.com


On Fri, Apr 8, 2011 at 6:08 PM, Mith Atul <at...@gmail.com> wrote:

> Thank you it worked.
> Can we use like operator  incase of case insensitive query.
>
>
>
> ---------- Forwarded message ----------
> From: SkipDever <sk...@thedevers.org>
> Date: Wed, Apr 6, 2011 at 10:28 PM
> Subject: RE: How to use LIKE operator
> To: user@ofbiz.apache.org
>
>
>            exprs.add(new EntityExpr(new EntityFunction.UPPER(new
> EntityFieldValue("infoString")), EntityOperator.LIKE, new
> EntityFunction.UPPER(("%" + email.toUpperCase()) + "%")));
>            List c =
> EntityUtil.filterByDate(delegator.findByAnd("PartyAndContactMech", exprs,
> UtilMisc.toList("infoString")), true);
>
> -----Original Message-----
> From: Mith Atul [mailto:atulmith@gmail.com]
> Sent: Wednesday, April 06, 2011 6:58 AM
> To: user@ofbiz.apache.org
> Subject: How to use LIKE operator
>
>
> Can u help me use the LIKE Operator in ofbiz .
> Can u give me a demo code on how to use the LIKE operator the  way
> from the delegator class.
> Thnks in adv .
>

Fwd: How to use LIKE operator

Posted by Mith Atul <at...@gmail.com>.
Thank you it worked.
Can we use like operator  incase of case insensitive query.



---------- Forwarded message ----------
From: SkipDever <sk...@thedevers.org>
Date: Wed, Apr 6, 2011 at 10:28 PM
Subject: RE: How to use LIKE operator
To: user@ofbiz.apache.org


           exprs.add(new EntityExpr(new EntityFunction.UPPER(new
EntityFieldValue("infoString")), EntityOperator.LIKE, new
EntityFunction.UPPER(("%" + email.toUpperCase()) + "%")));
           List c =
EntityUtil.filterByDate(delegator.findByAnd("PartyAndContactMech", exprs,
UtilMisc.toList("infoString")), true);

-----Original Message-----
From: Mith Atul [mailto:atulmith@gmail.com]
Sent: Wednesday, April 06, 2011 6:58 AM
To: user@ofbiz.apache.org
Subject: How to use LIKE operator


Can u help me use the LIKE Operator in ofbiz .
Can u give me a demo code on how to use the LIKE operator the  way
from the delegator class.
Thnks in adv .

Re: How to use LIKE operator

Posted by Deepak Dixit <de...@hotwaxmedia.com>.
And for groovy you can also use:

exprBldr = new EntityConditionBuilder();
delegator.findList("InvoiceItemType", exprBldr.LIKE("%" + anyString +"%"), null, null, null, false);


Thanks & Regards
-- 
Deepak Dixit
HotWax Media Pvt. Ltd.
www.hotwaxmedia.com
Contact :- +91-98267-54548
Skype  :- deepakdixit

On Apr 6, 2011, at 10:28 PM, SkipDever wrote:

>            exprs.add(new EntityExpr(new EntityFunction.UPPER(new
> EntityFieldValue("infoString")), EntityOperator.LIKE, new
> EntityFunction.UPPER(("%" + email.toUpperCase()) + "%")));
>            List c =
> EntityUtil.filterByDate(delegator.findByAnd("PartyAndContactMech", exprs,
> UtilMisc.toList("infoString")), true);
> 
> -----Original Message-----
> From: Mith Atul [mailto:atulmith@gmail.com]
> Sent: Wednesday, April 06, 2011 6:58 AM
> To: user@ofbiz.apache.org
> Subject: How to use LIKE operator
> 
> 
> Can u help me use the LIKE Operator in ofbiz .
> Can u give me a demo code on how to use the LIKE operator the  way
> from the delegator class.
> Thnks in adv .
> 


RE: How to use LIKE operator

Posted by SkipDever <sk...@thedevers.org>.
            exprs.add(new EntityExpr(new EntityFunction.UPPER(new
EntityFieldValue("infoString")), EntityOperator.LIKE, new
EntityFunction.UPPER(("%" + email.toUpperCase()) + "%")));
            List c =
EntityUtil.filterByDate(delegator.findByAnd("PartyAndContactMech", exprs,
UtilMisc.toList("infoString")), true);

-----Original Message-----
From: Mith Atul [mailto:atulmith@gmail.com]
Sent: Wednesday, April 06, 2011 6:58 AM
To: user@ofbiz.apache.org
Subject: How to use LIKE operator


Can u help me use the LIKE Operator in ofbiz .
Can u give me a demo code on how to use the LIKE operator the  way
from the delegator class.
Thnks in adv .