Skip to Content

Flexiquery Search to fetch order Model from DB


Using for loop, I am passing order codes one by one to fetch the OrderModel from DB through Flexible Search Query.

But the flexible search query is not working as expected, As only first time(first Loop) its fetch the Order Model, but from second loop, the flexible query return Order Model as null.

I debug the code and found that in DefaultFlexibleSearchService OOTB Class "jaloResult.getTotalCount() > 0" condition is not satisfied from 2 loop onwards.

Suggest how to resolved this issue, so that it will search all the valid orders from DB through Flexible Search Query.


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 20, 2015 at 03:20 AM

    Hi Deepak,

    For getting list of orders from list of codes we can use the below query snippet.

     select {OrderModel.PK} from {OrderModel._typecode} where {code} in ('code1','code2','code3'......)

    Its not required execute the flex query multiple times for diff codes.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.