.Net Cache TextQuery:cannot convert from 'Apache.Ignite.Core.Cache.Query.TextQuery' to 'Apache.Ignite.Core.Cache.Query.ScanQuery

classic Classic list List threaded Threaded
2 messages Options
siva siva
Reply | Threaded
Open this post in threaded view
|

.Net Cache TextQuery:cannot convert from 'Apache.Ignite.Core.Cache.Query.TextQuery' to 'Apache.Ignite.Core.Cache.Query.ScanQuery

This post was updated on .
Hi All,
I am using Apache Ignite v2.7.6.And I have a .Net core ClientServer Ignite App.
I am trying to read/search text from the Person Model field Payload marked with QueryTextField.
TextQuery Ignite Docs
Person Model:
 public class Person: IConstructionCacheStore
    {
        [QueryTextField]
        public string Payload { get; set; }
    }

Code:
 using (IIgniteClient client = Ignition.StartClient(this._igniteClientConfiguration))
            {
                //get cache config 
                var cache = client.GetCache<string, IConstructionCacheStore>(cacheName);
                try
                {
                    // Query for all people with "Master Degree" in their resumes.
                    var cursor = cache.Query(new TextQuery("Person", "Master Degree"));//Error

                    // Iterate over results. Using 'foreach' loop will close the cursor automatically.
                    foreach (var cacheEntry in cursor)
                        Console.WriteLine(cacheEntry.Value);
                }
                catch (Exception ex)
                {
                    throw;
                }

            }

But I am getting a compile-time error at
cache.Query(new TextQuery("Person", "Master Degree"));
 like
Error	CS1503	Argument 1: cannot convert from 'Apache.Ignite.Core.Cache.Query.TextQuery' to 'Apache.Ignite.Core.Cache.Query.ScanQuery<string, ConstructionModels.IConstructionCacheStore>'


How to solve the above error and other configurations needed?
Thanks.
ptupitsyn ptupitsyn
Reply | Threaded
Open this post in threaded view
|

Re: .Net Cache TextQuery:cannot convert from 'Apache.Ignite.Core.Cache.Query.TextQuery' to 'Apache.Ignite.Core.Cache.Query.ScanQuery

Hi,

TextQueryis not supported in Ignite thin clients [1]:

  • Use thick client instead (.NET thick client supports TextQuery)
  • Use Services or Compute as a workaround (wrap TextQuery call in a Service or Compute Task, use thin client to call the service or the task)


On Mon, Nov 30, 2020 at 7:54 AM siva <[hidden email]> wrote:
Hi All,
I am using Apache Ignite v2.7.6.And I have a .Net core ClientServer Ignite
App.
I am trying to read/search text from the Person Model field Payload marked
with QueryTextField.
TextQuery
<https://apacheignite-net.readme.io/v2.7.6/docs/cache-queries#text-queries>
Ignite Docs
*Model classes Interface:*


*Person Model:*


*Code:*


But I am getting a compile-time error at  like



How to solve the above error and other configurations needed?
Thanks.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/