Find your content:

Search form

You are here

Only receiving Single Result when querying HashtagDefinition


I have this query

List tagOptions  = [SELECT Name FROM HashtagDefinition];
List<String> tagNameOptions = new List<String>();
    for(HashtagDefinition htd : tagOptions){
return tagNameOptions;

But I am only receiving one tag back and in the dev org I have at least 3 separate hash tags.

Any thoughts on why this would be?

Attribution to: Jonathan Jenkins

Possible Suggestion/Solution #1

I just made a chatter post with the #Awesome hashtag. When I queried for this tag, it didn't appear straightaway.

When I tried again about 15 minutes later, the query returned the tag.

Whilst waiting I also clicked on the tag once to find all posts with that Hashtag.

So I would think there is an indexing job that runs periodically and scans posts to create HashtagDefinition records, rather than becoming available realtime.

This query result kinds ties in with the theory, tags I created at 20.03 and 20.05 only appeared at 21.00.31 - notice how the SystemModstamp on all 3 are the same. Signs of a batch-like process. (The Count increased for 1, and 2&3 were created)

    CreatedDate                 Name            SystemModstamp
1   2012-11-03T19:42:38.000Z    Awesome         2012-11-03T21:00:31.000Z
2   2012-11-03T20:03:50.000Z    wonderful       2012-11-03T21:00:31.000Z
3   2012-11-03T20:05:48.000Z    Love            2012-11-03T21:00:31.000Z

Attribution to: techtrekker
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content