たとえばlatitude
、longitude
フィールド(タイプ:)で自動インデックス作成を有効にすると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()
か?それは自動であるべきではありませんか?