1

We are facing an issue where few of our components are not appearing which we are exposing through OData.

When I hit the below query:

http://www-server.com/cd_webservice/odata.svc/ComponentPresentations?$filter=(TemplateId eq 111) and (PublicationId eq 22) and (ComponentId eq 555)

I get the expected output, whereas when I hit the below query:

http://www-server.com/cd_webservice/odata.svc/ComponentPresentations?$filter=(TemplateId eq 111) and (PublicationId eq 22)

I got results with many Components but the component "555" was missing from it which is weird.

I tried unpublishing the component (say "444") from the given results and refreshed the page & the component "444" disappeared from the results so it's clear that the query is not being cached.

On republishing the component "444", it starts appearing in the results whereas when I created the copy of the same component say "444-Copy" and published, it was missing from the OData response.

Not sure what could be the reason for this behavior, any help would be highly appreciated.

Thanks a lot in advance.

1 Answer 1

4

Maybe the problem is the number of results of the query.

By default the number of results are limited to 25, as it is configured in the cd_webservice_conf.xml

<OData>
    <DefaultTop>25</DefaultTop>
    <FixedPublicationId>1</FixedPublicationId>
</OData>

You can try changing this number or sorting the results to try to up your component to the first results to check this.

Including @Nuno remark about this answer, it can be added in the odata query string the meta top, to set the number of results, or "0" to get all the results; in the form of &$top=xx

4
  • 2
    You can also specify the maximum in the request itself, with something like &top=X. Use 0 to specify "no limit"
    – Nuno Linhares
    Commented Aug 29, 2017 at 8:59
  • Thanks!! It will take time to change the config and test but meanwhile, I tried to modify the query but still getting the same number of results, however, I can see the count in Broker DB is 260, is my query correct? www-server.com/cd_webservice/odata.svc/… eq 111) and (PublicationId eq 22) and (ComponentId eq 333) & top = 0 tried also with $top = 0 ; $top=300 But No Success.
    – Yash
    Commented Aug 29, 2017 at 10:42
  • Have you tried &$top=0 Commented Aug 29, 2017 at 13:07
  • Just tried now (&$top=0 without any space), and yes it worked!! thanks a lot, Nuno & Raul!!
    – Yash
    Commented Aug 29, 2017 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.