Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ce18fdd9
Commit
ce18fdd9
authored
Jan 19, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ES: optimize an index
parent
68b583ef
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
74 deletions
+22
-74
app/elastic/application_search.rb
app/elastic/application_search.rb
+5
-24
app/elastic/issues_search.rb
app/elastic/issues_search.rb
+2
-6
app/elastic/merge_requests_search.rb
app/elastic/merge_requests_search.rb
+4
-11
app/elastic/milestones_search.rb
app/elastic/milestones_search.rb
+2
-6
app/elastic/notes_search.rb
app/elastic/notes_search.rb
+1
-3
app/elastic/projects_search.rb
app/elastic/projects_search.rb
+5
-15
app/elastic/snippets_search.rb
app/elastic/snippets_search.rb
+3
-9
No files found.
app/elastic/application_search.rb
View file @
ce18fdd9
...
...
@@ -10,35 +10,16 @@ module ApplicationSearch
settings
\
index:
{
query:
{
default_field: :name
},
analysis:
{
analyzer:
{
my_analyzer
:{
type:
"custom"
,
tokenizer:
"ngram_tokenizer"
,
filter:
%w(lowercase asciifolding name_ngrams)
},
search_analyzer:
{
type:
"custom"
,
default
:{
tokenizer:
"standard"
,
filter:
%w(lowercase asciifolding)
filter:
[
"standard"
,
"lowercase"
,
"my_stemmer"
]
}
},
tokenizer:
{
ngram_tokenizer:
{
type:
"nGram"
,
min_gram:
1
,
max_gram:
20
,
token_chars:
%w(letter digit connector_punctuation punctuation)
}
},
filter:
{
name_ngrams:
{
type:
"nGram"
,
max_gram:
20
,
min_gram:
1
my_stemmer:
{
type:
"stemmer"
,
name:
"light_german"
}
}
}
...
...
app/elastic/issues_search.rb
View file @
ce18fdd9
...
...
@@ -9,13 +9,9 @@ module IssuesSearch
indexes
:iid
,
type: :integer
,
index: :not_analyzed
indexes
:title
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:description
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:created_at
,
type: :date
indexes
:updated_at
,
type: :date
indexes
:state
,
type: :string
...
...
app/elastic/merge_requests_search.rb
View file @
ce18fdd9
...
...
@@ -9,21 +9,14 @@ module MergeRequestsSearch
indexes
:iid
,
type: :integer
indexes
:target_branch
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
index_options:
'offsets'
analyzer: :my_analyzer
indexes
:source_branch
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:title
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:description
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:created_at
,
type: :date
indexes
:updated_at
,
type: :date
indexes
:state
,
type: :string
...
...
app/elastic/milestones_search.rb
View file @
ce18fdd9
...
...
@@ -7,13 +7,9 @@ module MilestonesSearch
mappings
do
indexes
:id
,
type: :integer
indexes
:title
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:description
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:project_id
,
type: :integer
indexes
:created_at
,
type: :date
...
...
app/elastic/notes_search.rb
View file @
ce18fdd9
...
...
@@ -7,9 +7,7 @@ module NotesSearch
mappings
do
indexes
:id
,
type: :integer
indexes
:note
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:project_id
,
type: :integer
indexes
:created_at
,
type: :date
...
...
app/elastic/projects_search.rb
View file @
ce18fdd9
...
...
@@ -8,25 +8,15 @@ module ProjectsSearch
indexes
:id
,
type: :integer
indexes
:name
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:path
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:name_with_namespace
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:path_with_namespace
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:description
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:namespace_id
,
type: :integer
...
...
app/elastic/snippets_search.rb
View file @
ce18fdd9
...
...
@@ -8,17 +8,11 @@ module SnippetsSearch
indexes
:id
,
type: :integer
indexes
:title
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:file_name
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:content
,
type: :string
,
index_options:
'offsets'
,
search_analyzer: :search_analyzer
,
analyzer: :my_analyzer
index_options:
'offsets'
indexes
:created_at
,
type: :date
indexes
:updated_at
,
type: :date
indexes
:state
,
type: :string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment