Skip to content
Snippets Groups Projects
Commit c169e8fd2ec4 authored by Samuel Trégouët's avatar Samuel Trégouët
Browse files

[es] automatically index `int` and `float` attributes

`indexable_attributes` in yams return only String and Bytes
parent 815e7137f527
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,14 @@
# Bytes
continue
data[attr] = value
for rschema, tschema in entity.e_schema.attribute_definitions():
if tschema.type in ('Int', 'Float'):
attr = rschema.type
try:
value = entity.cw_attr_cache[attr]
except KeyError:
continue
data[attr] = value
return data
......
......@@ -75,6 +75,12 @@
var = next(varmaker)
rql.append('%s %s %s' % (V, attr, var))
selected.append((attr, var))
for rschema, tschema in schema.eschema(etype).attribute_definitions():
if tschema.type in ('Int', 'Float'):
attr = rschema.type
var = next(varmaker)
rql.append('%s %s %s' % (V, attr, var))
selected.append((attr, var))
for attr in ('creation_date', 'modification_date'):
var = next(varmaker)
rql.append('%s %s %s' % (V, attr, var))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment