Indexing 索引中的arangodb查询值
我收集了一批棒球运动员,其结构如下:Indexing 索引中的arangodb查询值,indexing,nosql,arangodb,Indexing,Nosql,Arangodb,我收集了一批棒球运动员,其结构如下: { "name": "john doe", "education": [ "Community College", "University" ] } FOR school IN unique(( FOR player IN players COLLECT schools = playe
{
"name": "john doe",
"education": [
"Community College",
"University"
]
}
FOR school IN unique((
FOR player IN players
COLLECT schools = player.education
RETURN schools
)[**])
FILTER school != null
FILTER LOWER(school) LIKE CONCAT('%', @name, '%')
LIMIT 10
RETURN school
如果我想获得教育阵列中所有学校的列表,我可以执行以下操作:
{
"name": "john doe",
"education": [
"Community College",
"University"
]
}
FOR school IN unique((
FOR player IN players
COLLECT schools = player.education
RETURN schools
)[**])
FILTER school != null
FILTER LOWER(school) LIKE CONCAT('%', @name, '%')
LIMIT 10
RETURN school
但为了做到这一点,它必须接触收藏中的每一份文件。我建立了一个关于球员的索引。教育[*],它将包含所有的学校。是否有任何方法可以直接查询索引中的键(学校名称),而不必在每次需要运行查询时触摸集合中的每个记录?有两件事需要考虑:
过滤学校!=null
语句需要非稀疏散列索引(稀疏索引省略了null
值)LOWER(school)
和像这样的将始终触摸每个文档-没有索引会有帮助(它必须访问文档才能获得值,使其小写,等等)
gt
/lt
评估(“skiplist”)