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?
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);
QueryHandler.RemoveQueryResultCache(query);
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.
Hi,
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();
categories.Add(CategoryHandler.GetCategory(categoryId));
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.