Skip to content

Commit

Permalink
Merge pull request #467 from netarchivesuite/449-solr-highlights
Browse files Browse the repository at this point in the history
Make solr not return highlighting
  • Loading branch information
thomasegense authored Dec 19, 2024
2 parents d34189b + 590d320 commit 869f751
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ public class DomainStatisticsForDomainParser {

public static Map<String,List<FacetCount>> parseDomainStatisticsJson(String jsonString){
Map<String,List<FacetCount>> yearFacetDomainCountMap = new HashMap<String,List<FacetCount>>();

//Ugly quick hack for v.5.1.0 release.
//Solr 9 returns highlight attribute twice, and this is not allowed in json and parsing will fail.
//see https://github.com/netarchivesuite/solrwayback/issues/449
jsonString=jsonString.replaceFirst("\"highlighting\"", "\"highlighting1\"");//Rename first to highlighting1 HACK!



JSONObject json = new JSONObject(jsonString);
JSONObject jsonFacets = JsonUtils.getSubObjectIfExists(json, "facets");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ public String domainStatisticsForQuery(String query, List<String> fq, String sta
solrQuery.setQuery(query);
solrQuery.setRows(0);
solrQuery.set("facet", "false");
solrQuery.set("hl", "false");

// custom scale
String start = startdate + "T00:00:00Z";
Expand Down

0 comments on commit 869f751

Please sign in to comment.