0

I write this different queries for projectID in a site.

/_api/search/query?querytext='*'&$filter = projectID ne null&sourceid='d453a7990-05ea-4af9-81ef-edfab16c4e31'

Or

_api/search/query?querytext='sourceid='d453a7990-05ea-4af9-81ef-edfab16c4e31' AND projectID <> null'

Or

"/_api/search/query?querytext=''ViewXml':'&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;IsNotNull&gt;&lt;FieldRef Name='ProjectID' /&gt;&lt;/IsNotNull&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;'&sourceid='d453a7990-05ea-4af9-81ef-edfab16c4e31''

But nothing work. Kindly help

1
  • i don't think it will be null instead add filter for empty projectID ne '' Oct 16, 2017 at 6:37

1 Answer 1

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)'

References:

1
  • Hi Sathish, I have implemented ViewsLiffeTime, however below search don't return desire result: _api/search/query?querytext=%27NOT(viewslifetime:0)%27&$filter=ProjectID%20ne%20%27%27&rowlimit=500&selectproperties=%27ProjectID'&contentclass=STS_ListItem&trimduplicates=true Oct 17, 2017 at 1:29

Your Answer

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

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