Ignite 点燃无索引的质料

Ignite 点燃无索引的质料,ignite,Ignite,我想在ignite配置中使用索引设置QueryEntity,但不允许设置。我使用的是2.9.0。如果我不设置索引,那么它就不会创建表,也不会创建表。若我试图设置,那个么它会抛出下面链接中提到的异常 有人能告诉我如何设置没有索引的查询实体吗?也许我不明白,但我正在文档中尝试这一点,它可以工作: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.spr

我想在ignite配置中使用索引设置QueryEntity,但不允许设置。我使用的是2.9.0。如果我不设置索引,那么它就不会创建表,也不会创建表。若我试图设置,那个么它会抛出下面链接中提到的异常


有人能告诉我如何设置没有索引的查询实体吗?

也许我不明白,但我正在文档中尝试这一点,它可以工作:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">

    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <list>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="mycache"/>
                    <!-- Configure query entities -->
                    <property name="queryEntities">
                        <list>
                            <bean class="org.apache.ignite.cache.QueryEntity">
                                <!-- Setting indexed type's key class -->
                                <property name="keyType" value="java.lang.Long"/>

                                <!-- Setting indexed type's value class -->
                                <property name="valueType" value="org.apache.ignite.examples.Person"/>

                                <!-- Defining fields that will be either indexed or queryable. Indexed fields are added to 'indexes' list below.-->
                                <property name="fields">
                                    <map>
                                        <entry key="id" value="java.lang.Long"/>
                                        <entry key="name" value="java.lang.String"/>
                                        <entry key="salary" value="java.lang.Long "/>
                                    </map>
                                </property>

                                <!-- Defining indexed fields.-->
                                <property name="indexes">
                                    <list>
                                        <!-- Single field (aka. column) index -->
                                        <bean class="org.apache.ignite.cache.QueryIndex">
                                            <constructor-arg value="id"/>
                                        </bean>

                                        <!-- Group index. -->
                                        <bean class="org.apache.ignite.cache.QueryIndex">
                                            <constructor-arg>
                                                <list>
                                                    <value>id</value>
                                                    <value>salary</value>
                                                </list>
                                            </constructor-arg>
                                            <constructor-arg value="SORTED"/>
                                        </bean>
                                    </list>
                                </property>
                            </bean>
                        </list>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
</beans>

身份证件
薪水

您能显示您的配置吗?

问题已得到解决。设置QueryEntity时,需要设置键字段和QueryEntity中的字段。

删除索引部分,然后检查2.9.0是否将
ignite indexing
添加到类路径中?是的。我已经添加了该字段。那么,您不应该得到该异常。请提供完整的异常消息和堆栈跟踪以及缓存配置。