relatedUniqueIdentifier issue

I take it back, I've got NSUserActivity indexing to work on b3.


I've narrowed the issue down to the following:


If i set a relatedUniqueIdentifier (to anything) in a CSSearchableItemAttributeSet which is assigned to the NSUserActivity, the item doesn't get indexed.


If I leave the item without a uniqueID, it gets indexed.


This however poses a problem in regards to the whole de-duplication thing!


If I have time tomorrow I'll post a radar. Anyone else have this issue? Just me?

Accepted Reply

You need to add the item to the index first. You should be able to simply add it to the index with the unique identifier, even with minimal information, and then you could (if necessary) update it later. If you're setting the relatedUniqueIdentifier, then that identifier needs to be in the index.

Replies

How does this help if your are only using the NSUserActivty and not Core Spotlight. I am getting duplicate results as well. I tried adding the activity and the updating it using updateUserActivityState: but if I add the relatedUniqueIdentifier is does not get indexed at all.

If you're not using CoreSpotlight then there's no reason to be setting a relatedUniqueIdentifier. That property is only for linking an NSUserActivity to a CoreSpotlight item. If you're only using NSUserActivity and web markup, then set the webpageURL on the NSUserActivity to the page that it corresponds to.