0

I'm trying to do a search with the REST API sorting by ViewsLifeTime but the result search contains documents with ViewsLifeTime value is null, how can I avoid that?

2
  • what is the SharePoint version you are referring
    – kesava
    Jul 30 '15 at 3:11
  • Sharepoint online
    – yngrdyn
    Jul 30 '15 at 13:34
2

First enable Search and Query property for "ViewsLifeTime" managed property in search service and perform full crawl.

Use Search Query API for not returning the items for which "ViewsLifeTime" count is null

https://domain.com/_api/search/query?querytext='NOT(viewslifetime:0)'

Reference Links :- [Filter for Empty Values in Search][1]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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