Skip to content

Commit

Permalink
Merge pull request #39 from NASA-PDS/NASA-PDS/registry-legacy-solr#130
Browse files Browse the repository at this point in the history
Update servlet to support custom faceting and new `keyword` request handler
  • Loading branch information
jordanpadams authored Oct 7, 2024
2 parents 2ba17ed + 73584db commit cbe9d57
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"filename": "src/main/java/gov/nasa/pds/search/servlet/RegistryLegacyServlet.java",
"hashed_secret": "4fb813c304003b3813b35a85f05b7cb0c3994cc1",
"is_verified": false,
"line_number": 121,
"line_number": 123,
"is_secret": false
}
],
Expand Down Expand Up @@ -216,5 +216,5 @@
}
]
},
"generated_at": "2024-08-24T23:35:32Z"
"generated_at": "2024-10-07T13:30:59Z"
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>9.6.1</version>
<version>9.7.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ public class RegistryLegacyServlet extends HttpServlet {

private static List<String> SOLR_QUERY_PARAMS =
new ArrayList<String>(
List.of("q", "sort", "start", "rows", "fq", "fl", "wt", "json.wrf", "_"));
List.of("q", "sort", "start", "rows", "fq", "fl", "wt", "json.wrf", "_", "facet.field",
"facet", "facet.sort", "facet.mincount", "facet.method", "facet.excludeTerms",
"facet.pivot", "facet.contains"));
private static List<String> SOLR_FACET_FIELDS =
new ArrayList<String>(List.of("facet_agency", "facet_instrument", "facet_investigation",
"facet_target", "facet_type", "facet_pds_model_version", "facet_primary_result_purpose",
"facet_primary_result_processing_level"));
private static List<String> REQUEST_HANDLERS =
new ArrayList<String>(List.of("search", "archive-filter", "select"));
new ArrayList<String>(List.of("search", "archive-filter", "select", "keyword"));
private static String REQUEST_HANDLER_PARAM = "qt";
private static String SOLR_BASE_URL = "http://localhost:8983/solr";
private static String SOLR_COLLECTION = "data";
Expand Down
9 changes: 3 additions & 6 deletions src/main/webapp/search.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ for (String name : params.keySet()) {
$(function() {
//var query = window.location.href.slice(window.location.href.indexOf('?') + 1).split('@@');
var query = '<%= query %>';
$.get('/services/search/search?' + query, function(data) {
$('.output').html(data);
});
$.get('/services/search/search?qt=archive-filter&' + query, function(data) {
$('.output').html(data);
});
});
</script>

</head>
Expand Down Expand Up @@ -122,9 +122,6 @@ $(function() {
<!-- Added to contain search service output -->
<div class="output"></div>

<!-- Commented out for new search service functionality -->
<!-- jsp:include page="http://pdsbeta:8080/search-service/select/" / -->

<!-- InstanceEndEditable -->

<c:import url="/footer.html" context="/include" />
Expand Down

0 comments on commit cbe9d57

Please sign in to comment.