You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by wt <wa...@gmail.com> on 2018/09/26 11:25:25 UTC

ignite .net index group definition

Hi

In java a the index groups are defined in a way that makes sense e.g.

@QuerySqlField(orderedGroups={@QuerySqlField.Group(
    name = "age_salary_idx", order = 0, descending = true)})

in .net however it looks like this

[QuerySqlField(IsIndexed =true, IndexGroups = new[] {"someIndexGroup"})]

My question is in .net how can i apply the same concept where each group has
its on specific config? I can't find any documentation that shows this
because it would appear to be needed to be something like the following but
i just want to confirm the format

[QuerySqlField(IsIndexed =true, IndexGroups = new[] {"name = someIndexGroup,
order =0, descending = true" , "name = InAnotherIndexGroup, order =0,
descending = true"})]



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

Re: ignite .net index group definition

Posted by Pavel Tupitsyn <pt...@apache.org>.
You should not have to revert to Spring XML.
Just use QueryIndex class in C# and pass field names there in desired order
to create a group index.

                    new CacheConfiguration(...)
                    {
                        Indexes = new[]
                        {
                            new QueryIndex("Age", "Size")
                        }
                    }




On Mon, Oct 1, 2018 at 6:10 PM Ilya Kasnacheev <il...@gmail.com>
wrote:

> Hello!
>
> You can also use CREATE TABLE/INDEX and then any API that you like to
> query data (i.e. SQL, Cache API, REST).
>
> How the cache was created doesn't affect its usage much.
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> пн, 1 окт. 2018 г. в 11:07, wt <wa...@gmail.com>:
>
>> So are you saying that i have to revert to the spring xml to get this
>> done?
>>
>> I am using query entities when trying to do this but the order field
>> doesn't
>> seem to apply in the .net API.
>>
>>  foreach (var field in item.Columns)
>>                 {
>>                     properties.Add(new Property()
>>                     {
>>                         Name = field.ColumnName,
>>                         Type = ChangeType(field.DataType), --data type
>>                         Attributes = new List<string>()
>>                         { MakeIndexConfig(field)} -- here is where i set
>> the
>> fields and indexes
>>                     });
>>
>>                 }
>>
>> I guess another option might be to use the rest service and issue create
>> index statements.
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>

Re: ignite .net index group definition

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

You can also use CREATE TABLE/INDEX and then any API that you like to query
data (i.e. SQL, Cache API, REST).

How the cache was created doesn't affect its usage much.

Regards,
-- 
Ilya Kasnacheev


пн, 1 окт. 2018 г. в 11:07, wt <wa...@gmail.com>:

> So are you saying that i have to revert to the spring xml to get this done?
>
> I am using query entities when trying to do this but the order field
> doesn't
> seem to apply in the .net API.
>
>  foreach (var field in item.Columns)
>                 {
>                     properties.Add(new Property()
>                     {
>                         Name = field.ColumnName,
>                         Type = ChangeType(field.DataType), --data type
>                         Attributes = new List<string>()
>                         { MakeIndexConfig(field)} -- here is where i set
> the
> fields and indexes
>                     });
>
>                 }
>
> I guess another option might be to use the rest service and issue create
> index statements.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: ignite .net index group definition

Posted by wt <wa...@gmail.com>.
So are you saying that i have to revert to the spring xml to get this done?

I am using query entities when trying to do this but the order field doesn't
seem to apply in the .net API.

 foreach (var field in item.Columns)
                {
                    properties.Add(new Property()
                    {
                        Name = field.ColumnName,
                        Type = ChangeType(field.DataType), --data type
                        Attributes = new List<string>()
                        { MakeIndexConfig(field)} -- here is where i set the
fields and indexes
                    });

                }

I guess another option might be to use the rest service and issue create
index statements. 



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

Re: ignite .net index group definition

Posted by Pavel Tupitsyn <pt...@apache.org>.
Hi,

Yes, attribute-based configuration is limited in this regard.
But, as Ilya said, `CacheConfiguration.QueryEntities` gives you full
control to achieve the same.

Thanks,
Pavel

On Thu, Sep 27, 2018 at 6:46 PM ilya.kasnacheev <il...@gmail.com>
wrote:

> Hello!
>
> Unfortunately this looks like a genuine limitation of .Net's QuerySqlField.
>
> You can try specifying those indexes with QueryEntities or CREATE INDEX
> instead to have more control.
>
> Regards,
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: ignite .net index group definition

Posted by "ilya.kasnacheev" <il...@gmail.com>.
Hello!

Unfortunately this looks like a genuine limitation of .Net's QuerySqlField.

You can try specifying those indexes with QueryEntities or CREATE INDEX
instead to have more control.

Regards,



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

Re: ignite .net index group definition

Posted by wt <wa...@gmail.com>.
anyone? 

i have tried applying it like this but it just creates 2 indexes

 [QuerySqlField(IsIndexed = true,  IndexGroups = new[] { "name=aa,order=1"
})]

My understanding is under the hood it is essentially  btree index and these
index structures require an ordinal column configuration to build the index
structure according to the first column of the index. If ignite is just
randomly putting these columns in there then performance won't be optimal.

can anyone provide further info please?



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