Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update servlet to support custom faceting and new keyword request handler #39

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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