Select query with sorting for cassandra with stratio lucene index, version >2.2

318 Views Asked by At

I am trying to test out stratio lucene index for Cassandra database in various release versions, and I'm having a problem when going past version 2.2:

Suppose I have a table with a column mymap which is of type map<text, text>, and I have it indexed with sorting options using lucene index:

CREATE CUSTOM INDEX myindex
ON mytable (lucene_index)
USING 'com.stratio.cassandra.lucene.Index'
WITH OPTIONS = {
    'refresh_seconds': '10',
    'schema' : '{            
        fields : {
            mymap: {
              type: "string",
              sorted: true
            }
        }
    }'
};

Up until version 2.1 of cassandra - lucene suite I was able to have a working select query which involved lucene index sorting:

select * from mytable
where lucene_index = '{
    sort: {
        fields: [{field:"mymap.attr"}]
    }, 
    refresh: true
}';

The query would fetch results sorted by the attr1 map value of the mymap column, given that there were rows with that specific map attribute for the column.

When going past version 2.2 all the element.property syntax for queries, filters or sorts was changed to element$property, however if I make the change in my select query the sorting won't work, and I can even reference inexistent fields within the column.

1

There are 1 best solutions below

0
Eduardo Alonso On

This is a bug involving 2.2.X branch. Now it is fixed in 2.2.7.1.