Skip to content

Commit f524141

Browse files
#38; more on tests
1 parent bdc9358 commit f524141

File tree

1 file changed

+10
-10
lines changed
  • examples/simple/search_indexes/viewsets

1 file changed

+10
-10
lines changed

examples/simple/search_indexes/viewsets/book.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,11 @@ class BookDocumentViewSet(BaseDocumentViewSet):
5252
HighlightBackend,
5353
]
5454
# Define search fields
55-
# search_fields = (
56-
# 'title',
57-
# 'description',
58-
# 'summary',
59-
# )
60-
search_fields = {
61-
'title': {'boost': 4},
62-
'summary': {'boost': 2},
63-
'description': None,
64-
}
55+
search_fields = (
56+
'title',
57+
'description',
58+
'summary',
59+
)
6560
# Define highlight fields
6661
highlight_fields = {
6762
'title': {
@@ -211,4 +206,9 @@ class BookDocumentViewSet(BaseDocumentViewSet):
211206
class BookOrderingByScoreDocumentViewSet(BookDocumentViewSet):
212207
"""Same as BookDocumentViewSet, but sorted by _score."""
213208

209+
search_fields = {
210+
'title': {'boost': 4},
211+
'summary': {'boost': 2},
212+
'description': None,
213+
}
214214
ordering = ('_score', 'id', 'title', 'price',)

0 commit comments

Comments
 (0)