cancel
Showing results for 
Search instead for 
Did you mean: 

ModelNotFoundException while searching with DefaultItemModelSearchStrategy.getModelByExample()

Former Member
0 Kudos

Hi Experts,

We are getting ModelNotFoundException while searching with DefaultItemModelSearchStrategy.getModelByExample().

But we are getting the results in backoffice and even flexible search.

hope this might be causing with restrictions, but getting the results in flexible search the same will applicable to getModelByExample() too.

Could you please confirm how they are invoking getModelByExample() is it on flexiblesearch or is there any otherway.

Thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member620692
Active Contributor
0 Kudos

If you are executing the FS Query in hAC, the result will be different because you may be logged to hAC using admin/nimda to which no restriction is applicable. The function, getModelByExample uses FlexibleSearch. Did you try disbaling search restrictions using searchRestrictionService.disableSearchRestrictions()?

Former Member
0 Kudos

How do you create the model (new MyModel() or modelService.create(MyModel.class))?

If you use the second one, default values will be set to the Model.

You can also check the JDBC logging in the HAC to check the actual query.