Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
elasticsearch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
elasticsearch
Commits
c169e8fd2ec4
Commit
c169e8fd2ec4
authored
8 years ago
by
Samuel Trégouët
Browse files
Options
Downloads
Patches
Plain Diff
[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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entities.py
+8
-0
8 additions, 0 deletions
entities.py
es.py
+6
-0
6 additions, 0 deletions
es.py
with
14 additions
and
0 deletions
entities.py
+
8
−
0
View file @
c169e8fd
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
es.py
+
6
−
0
View file @
c169e8fd
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment