Alachisoft / NCache

NCache: Highly Scalable Distributed Cache for .NET
http://www.alachisoft.com
Apache License 2.0
647 stars 123 forks source link

Named Tags Query Fails with 'Index not defined' error. #42

Open DAConsulting opened 5 years ago

DAConsulting commented 5 years ago

Queries on named tags do not seem to work.

We are creating our CashItems() with a Tag dictionary, like this:

`tagDict.Add("GameKey", aKey.GameKey); tagDict.Add("StatType", aKey.StatType);

aKeys.Add(somekey); aItems.Add(new CacheItem(a) {NamedTags = tagDict});`

Later, we try to search the cache based on tags which is just following the GroupsAndTags example:

`string query = "SELECT $Text$ WHERE this.GameKey = ? AND this.StatType = ?";

Dictionary<string,string> values = new Dictionary<string,string>(); values["GameKey"] = theGameKey; values["StatType"] = theStatType;

CacheReader resultItems = _cache.ExecuteReader(query, values); `

... but we get this error:

“ExecuteReader operation failed. Error: Index is not defined for attribute 'GameKey'”

According to the documentation: Queries require Named Tags, Indexes on the object or both”

In this case, we’re using Named Tags, but it still fails.

How do we defined an Index on a Named Tag? Or?....

This looks like a bug.

Mark-NCache commented 4 years ago

Hi @DAConsulting, I've tried to reproduce this issue with 4.9 SP1 and 5.0 SP2 and unfortunately I've not been able to do it. Can you please share a working sample with me which will help me in reproducing this issue.