From dd45e0f32775b81b1db2998f2e096622db888850 Mon Sep 17 00:00:00 2001 From: michael-lewis Date: Sat, 21 Jan 2023 15:31:23 +0000 Subject: [PATCH] Explicitly set hl.method to original and hl.fragsize to 100 so there is no change to highlighting behaviour after #85 Upgrade from Solr 8.11.1 to 9.1.0 --- src/web/content/dynamic/searchmysite/solr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/web/content/dynamic/searchmysite/solr.py b/src/web/content/dynamic/searchmysite/solr.py index c3aa299..21077e6 100644 --- a/src/web/content/dynamic/searchmysite/solr.py +++ b/src/web/content/dynamic/searchmysite/solr.py @@ -50,8 +50,10 @@ "fl": ["id", "url", "title", "description", "contains_adverts", "published_date"], "q.op": "AND", "fq": mandatory_filter_queries_search, - "hl": "on", + "hl": True, "hl.fl": ["content", "description"], + "hl.method": "original", # default is "original" in Sol 8 but "unified" in Solr 9. Unfortunately "unified" in Solr 9.0 seems to ignore hl.fragsize + "hl.fragsize": 100, "hl.simple.pre": split_text, "hl.simple.post": split_text, "group": True, @@ -59,6 +61,7 @@ "group.limit": 3, "group.ngroups": True } + query_facets_search = { "site_category": { "field": "site_category", "type": "terms", "limit": 2, "sort": "count" }, "in_web_feed": { "field": "in_web_feed", "type": "terms", "limit": 2, "sort": "count" },