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
4c406b718a92
Commit
4c406b718a92
authored
8 years ago
by
Arthur Lutz
Browse files
Options
Downloads
Patches
Plain Diff
[views] use compose_query from search_helpers
parent
a0d74ef12c90
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views.py
+7
-0
7 additions, 0 deletions
views.py
with
7 additions
and
0 deletions
views.py
+
7
−
0
View file @
4c406b71
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
from
cubicweb.view
import
StartupView
from
cubicweb.view
import
StartupView
from
cubes.elasticsearch.es
import
indexable_types
from
cubes.elasticsearch.es
import
indexable_types
from
cubes.elasticsearch.search_helpers
import
compose_search
def
get_connection
(
config
):
def
get_connection
(
config
):
...
@@ -58,6 +59,12 @@
...
@@ -58,6 +59,12 @@
self
.
doc_types
=
doc_types
self
.
doc_types
=
doc_types
super
(
CWFacetedSearch
,
self
).
__init__
(
query
,
filters
)
super
(
CWFacetedSearch
,
self
).
__init__
(
query
,
filters
)
def
query
(
self
,
search
,
query
):
if
query
:
return
compose_search
(
search
,
query
=
query
,
fields
=
self
.
fields
)
#return search.query('multi_match', fields=self.fields, query=query)
return
search
def
highlight
(
self
,
search
):
def
highlight
(
self
,
search
):
"""
"""
Add custom highlighting
Add custom highlighting
...
...
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