3

たとえばlatitudelongitudeフィールド(タイプ:)で自動インデックス作成を有効にするとdouble、このクエリを実行できません

autoIndex.query(
            QueryContext.numericRange(
                    'longitude',
                    16.598145,
                    46.377254
            )
    );

autoIndexとして定義されgraphDb.index().getNodeAutoIndexer().getAutoIndex()ます。
単純に結果のサイズはsize=0です。


のような他のクエリ

autoIndex.get(...)

また

autoIndex.query('id', new QueryContext("*").sort(sort))

うまく動作します。


locations_indexただし、手動でインデックスを追加した場合

    ValueContext latValue = new ValueContext(node.getProperty('latitude')).indexNumeric();
    ValueContext lonValue = new ValueContext(node.getProperty('longitude')).indexNumeric();

    locationsIndex.add(node, 'latitude', latValue);
    locationsIndex.add(node, 'longitude', lonValue);

データベース内の緯度/経度ごとに、クエリが機能します。

私の質問は-数値フィールドに自動的にインデックスを付ける方法はありますValueContext.indexNumeric()か?それは自動であるべきではありませんか?

4

0 に答える 0