Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
slide-index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Welter, Felix
slide-index
Commits
24173a72
Commit
24173a72
authored
4 years ago
by
felixwelter
Browse files
Options
Downloads
Patches
Plain Diff
Rename SearchIndex to BasicSearchIndex
parent
516db59d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
search_index.py
+2
-2
2 additions, 2 deletions
search_index.py
with
2 additions
and
2 deletions
search_index.py
+
2
−
2
View file @
24173a72
...
@@ -6,7 +6,7 @@ from whoosh.fields import TEXT, Schema, ID, NUMERIC
...
@@ -6,7 +6,7 @@ from whoosh.fields import TEXT, Schema, ID, NUMERIC
from
whoosh.qparser
import
QueryParser
,
OrGroup
from
whoosh.qparser
import
QueryParser
,
OrGroup
class
SearchIndex
:
class
Basic
SearchIndex
:
def
__init__
(
self
,
index_dir
=
"
index
"
):
def
__init__
(
self
,
index_dir
=
"
index
"
):
self
.
schema
=
Schema
(
path
=
ID
(
stored
=
True
),
page
=
NUMERIC
(
stored
=
True
),
content
=
TEXT
(
stored
=
True
))
self
.
schema
=
Schema
(
path
=
ID
(
stored
=
True
),
page
=
NUMERIC
(
stored
=
True
),
content
=
TEXT
(
stored
=
True
))
try
:
try
:
...
@@ -32,7 +32,7 @@ class SearchIndex:
...
@@ -32,7 +32,7 @@ class SearchIndex:
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
os
.
makedirs
(
"
index_test
"
)
os
.
makedirs
(
"
index_test
"
)
index
=
SearchIndex
(
"
index_test
"
)
index
=
Basic
SearchIndex
(
"
index_test
"
)
index
.
add
(
path
=
u
"
/world
"
,
page
=
1
,
content
=
u
"
this is a test about the world
"
)
index
.
add
(
path
=
u
"
/world
"
,
page
=
1
,
content
=
u
"
this is a test about the world
"
)
index
.
add
(
path
=
u
"
/fire
"
,
page
=
2
,
content
=
u
"
i could not imagine the heat or the regression
"
)
index
.
add
(
path
=
u
"
/fire
"
,
page
=
2
,
content
=
u
"
i could not imagine the heat or the regression
"
)
index
.
add
(
path
=
u
"
/dream
"
,
page
=
3
,
content
=
u
"
dreaming is special not only to humans but all animals
"
)
index
.
add
(
path
=
u
"
/dream
"
,
page
=
3
,
content
=
u
"
dreaming is special not only to humans but all animals
"
)
...
...
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