Skip to content

Commit 9b02755

Browse files
authored
Merge pull request #86 from mr-sphere/raw-sort-by
sort on raw title
2 parents 7ea65d6 + 181c3c1 commit 9b02755

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

oscar_elasticsearch/search/settings.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@
9999
SORT_BY_MAP_SEARCH = getattr(
100100
settings,
101101
"OSCAR_ELASTICSEARCH_SORT_BY_MAP_SEARCH",
102-
{NEWEST: "-date_created", POPULARITY: "-popularity"},
102+
{
103+
NEWEST: "-date_created",
104+
POPULARITY: "-popularity",
105+
TITLE_A_TO_Z: "title.raw",
106+
TITLE_Z_TO_A: "-title.raw",
107+
},
103108
)
104109

105110
SORT_BY_CHOICES_CATALOGUE = getattr(
@@ -126,8 +131,8 @@
126131
POPULARITY: "-popularity",
127132
PRICE_HIGH_TO_LOW: "-price",
128133
PRICE_LOW_TO_HIGH: "price",
129-
TITLE_A_TO_Z: "title",
130-
TITLE_Z_TO_A: "-title",
134+
TITLE_A_TO_Z: "title.raw",
135+
TITLE_Z_TO_A: "-title.raw",
131136
},
132137
)
133138

0 commit comments

Comments
 (0)