CategoryHandler.GetCategorizedItems vs. GetQueryResult



I have some code that I would think works in a similar way - but turns out to give me different outpu. I am now quite confused and would relly like some help here!

Code A:
CategoryCollection categories = new CategoryCollection();
this.TheRepeater.DataSource =
CategoryHandler.GetCategorizedItems(typeof(Club), categories, page, pagesPerPage, out totalItems);

Returns wanted result.

Code B:
ClubQuery clubQuery = new ClubQuery();
clubQuery.Categories = new CategoryCollectionCriterion();
clubQuery.Categories.Containing = new CategoryCriterion();
clubQuery.Categories.Containing.ID = new IntegerCriterion();
clubQuery.Categories.Containing.ID.Value = categoryId;
this.TheRepeater.DataSource = ClubHandler.GetQueryResult(clubQuery, page, pagesPerPage, out totalItems);

Does not return anything.

Sep 03, 2008 14:00

Hi Jonas,

It should result in the same data being returned, except for the matter of sorting.

Have you verified what the value of totalItems is after running GetQueryResult? 

Sep 05, 2008 10:06
Hmm... the ClubQuery method seems to work rather randomized for me. Exactly the same query on the same page produces different results. If I search using one criteria, A, then searches using another criteria, and finally search using A again, A produces different result. Is this a cache issue perhaps?
Sep 08, 2008 13:33

There is a cache issue in the query system that has been resolved and will be fixed with an update in a near future. This sounds like the problem in question.

You could work around this problem by clearing the query cache before executing the query by calling QueryHandler.RemoveQueryResultCache(query); 

Sep 09, 2008 10:43


Where is this method located?

As in wich dll? We have searched for this quite extensively, but not found it.


We ended up using:

StarSuite.Core.Cache.CacheHandler.RemoveCachedObject(new string[] { "StarCommunityQueries", "Query" });

wich is quite inefficient and dirty, but atleast it works.

Oct 27, 2008 14:21
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.