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
67b13eecf542
Commit
67b13eecf542
authored
8 years ago
by
Arthur Lutz
Browse files
Options
Downloads
Patches
Plain Diff
[es.py] small library to compute indexable types
parent
70fdf9d3b424
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
es.py
+33
-0
33 additions, 0 deletions
es.py
with
33 additions
and
0 deletions
es.py
0 → 100644
+
33
−
0
View file @
67b13eec
# -*- coding: utf-8 -*-
# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr -- mailto:contact@logilab.fr
INDEXABLE_TYPES
=
None
def
index_settings
():
return
{
'
analysis
'
:
{
'
analyzer
'
:
{
'
default
'
:
{
'
filter
'
:
[
'
standard
'
,
'
my_ascii_folding
'
],
'
tokenizer
'
:
'
standard
'
}},
'
filter
'
:
{
'
my_ascii_folding
'
:
{
'
preserve_original
'
:
True
,
'
type
'
:
'
asciifolding
'
}}}}
def
indexable_types
(
schema
):
global
INDEXABLE_TYPES
if
INDEXABLE_TYPES
is
not
None
:
return
INDEXABLE_TYPES
indexable_types
=
[]
skip_list
=
(
'
TrInfo
'
,
'
EmailAddress
'
)
for
eschema
in
schema
.
entities
():
if
eschema
.
type
in
skip_list
:
continue
if
not
eschema
.
final
:
# check eschema.fulltext_relations() ? (skip wf_info_for ?
# )
if
list
(
eschema
.
indexable_attributes
()):
indexable_types
.
append
(
eschema
.
type
)
INDEXABLE_TYPES
=
indexable_types
return
indexable_types
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