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
4f4f42c7bebf
Commit
4f4f42c7bebf
authored
8 years ago
by
Adrien Di Mascio
Browse files
Options
Downloads
Patches
Plain Diff
[ccplugin] change --etype option to --etypes
same thing for --except_etype
parent
7eebe9f503ee
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
ccplugin.py
+11
-11
11 additions, 11 deletions
ccplugin.py
es.py
+1
-2
1 addition, 2 deletions
es.py
with
12 additions
and
13 deletions
ccplugin.py
+
11
−
11
View file @
4f4f42c7
...
...
@@ -39,12 +39,12 @@
(
'
debug
'
,
{
'
type
'
:
'
yn
'
,
'
default
'
:
False
,
'
help
'
:
'
set to True if you want to print
'
'
out debug info and progress
'
}),
(
'
etype
'
,
{
'
type
'
:
'
string
'
,
'
default
'
:
''
,
'
help
'
:
'
only index
a
given etype
'
'
[default:all indexable types]
'
}),
(
'
except-etype
'
,
{
'
type
'
:
'
string
'
,
'
default
'
:
''
,
'
help
'
:
'
all indexable types except given etype
'
'
[default:
None
]
'
}),
(
'
etype
s
'
,
{
'
type
'
:
'
csv
'
,
'
default
'
:
''
,
'
help
'
:
'
only index given etype
s
'
'
[default:all indexable types]
'
}),
(
'
except-etype
s
'
,
{
'
type
'
:
'
string
'
,
'
default
'
:
''
,
'
help
'
:
'
all indexable types except given etype
s
'
'
[default:
[]
]
'
}),
]
def
run
(
self
,
args
):
...
...
@@ -56,7 +56,7 @@
es
=
indexer
.
get_connection
()
indexer
.
create_index
()
if
es
:
if
self
.
config
.
etype
:
etypes
=
(
self
.
config
.
etype
,)
if
self
.
config
.
etype
s
:
etypes
=
self
.
config
.
etype
s
else
:
etypes
=
indexable_types
(
schema
,
...
...
@@ -61,8 +61,8 @@
else
:
etypes
=
indexable_types
(
schema
,
custom_skip_list
=
((
self
.
config
.
except_etype
,))
)
assert
self
.
config
.
except_etype
not
in
etypes
if
self
.
config
.
debug
and
not
self
.
config
.
etype
:
custom_skip_list
=
self
.
config
.
except_etype
s
)
assert
self
.
config
.
except_etype
s
not
in
etypes
if
self
.
config
.
debug
and
not
self
.
config
.
etype
s
:
print
(
u
'
found indexable_types {}
'
.
format
(
'
,
'
.
join
(
etypes
)))
for
_
in
parallel_bulk
(
es
,
...
...
This diff is collapsed.
Click to expand it.
es.py
+
1
−
2
View file @
4f4f42c7
...
...
@@ -41,6 +41,6 @@
if
INDEXABLE_TYPES
is
not
None
:
return
INDEXABLE_TYPES
indexable_types
=
[]
skip_list
=
(
'
TrInfo
'
,
'
EmailAddress
'
)
skip_list
=
[
'
TrInfo
'
,
'
EmailAddress
'
]
if
custom_skip_list
:
skip_list
=
skip_list
+
custom_skip_list
...
...
@@ -45,6 +45,5 @@
if
custom_skip_list
:
skip_list
=
skip_list
+
custom_skip_list
print
skip_list
for
eschema
in
schema
.
entities
():
if
eschema
.
type
in
skip_list
:
continue
...
...
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