SharePoint Online here. I'm trying to create a result source that only contains external users. In local AD we distinguish external users from internal ones with the LDAP property 'company'. This property contains the external companie's name and is blank to indicate an internal user.

Since this is not synched to the user profile service we used a script to create a custom user profile property with the same name of 'company'.

As a result, this property is available as the crawled property 'People:SPS-Company'.

Next, I mapped this crawled property to 'RefinableString135'.

So when I launch the query builder for the new result source I cannot seem to find a query that only shows users where 'RefinableString135' is populated. It always shows all users.

I tried RefinableString135:{searchTerms} and {searchTerms} RefinableString135:*. I read that with KQL one cannot query for 'not null' but the goal I'm trying to achieve doesn't sound too complicated. I guess there is some other kind of logic and I've approached this all wrong. Would appreciate your help.


2 Answers 2


Try This:



  • Thanks. Doesn't work, unfortunately. It shows all results so the query is equal to RefinableString135:*. As far as I know empty property values are not indexed in SharePoint. Apr 11, 2019 at 8:13

Decided to give those previously empty AD values values in order to make it work. Now I can query for all values not the one I want to be excluded.

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.