SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The rest query is as follows, I want to get most viewed pages. I have used ViewsLifeTime property. This query returns some pages (unwanted) which their ViewsLifeTime is null.'ContentTypeId:0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39*'&sortlist='ViewsLifeTime:descending'&filter=ViewsLifeTime gt '0'

I have tested with eq, ne as well.

The ViewsLifeTime of unwanted pages is like:

<d:element m:type="SP.KeyValue">
  <d:Value m:null="true"/>

But I want to have those pages is viewed (ViewsLifeTime is not null) like:

 <d:element m:type="SP.KeyValue">

The other problem with this query is it returns all pages within the farm. I want to get pages only from current Site collection.

How do I filter out those pages that have not been viewed (ViewsLifeTime is null) and restrict the result to current Site Collection?

share|improve this question

I don't think the $filter parameter works on the search API. You need to specify the filters in the querytext parameter.


As for the specific to site collection. There is a WebID property for the querytext, not sure about Site Collection.

What I do is test my querytext in the standard SharePoint search box to get my query string value for my api calls!

share|improve this answer
Try level=sitecol for site collection only – SteveCl Dec 3 '13 at 13:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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