GridGain Community Edition

Expand all | Collapse all

Spring Indexing example

  • 1.  Spring Indexing example

     
    Posted 06-25-2019 02:59 PM
    Hello all. I'm looking for a way to sort createdTime descending and processedTime ascending. What would the definition look
    like? Here's the index definition

    <bean
    class="org.apache.ignite.cache.QueryIndex">
    <constructor-arg>
    <list>
    <value>recId</value>
    <value>createdTime</value>
    <value>processedTime</value>
    <value>partitionId</value>
    </list>
    </constructor-arg>
    <constructor-arg value="SORTED"/>
    </bean>


  • 2.  RE: Spring Indexing example

    Posted 06-26-2019 03:04 AM
    Hello!

    You will need to use (LinkedHashMap, QueryIndexType) constructor for that:

    <bean class="org.apache.ignite.cache.QueryIndex">
    <constructor-arg>
    <map value-type="java.lang.Boolean">
    <entry key="recId" value="true"/>
    <entry key="createdTime" value="false"/>
    <entry key="processedTime" value="true"/>
    <entry key="partitionId" value="true"/>
    </map>
    </constructor-arg>
    <constructor-arg value="SORTED"/>
    </bean>

    Something like that!

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------