mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
dspace-api: set search fields in Solr query only if we are interested in the actual search results
This commit is contained in:
@@ -861,6 +861,9 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
|
|
||||||
solrQuery.setQuery(query);
|
solrQuery.setQuery(query);
|
||||||
|
|
||||||
|
if (discoveryQuery.getMaxResults() != 0) {
|
||||||
|
// set search fields in Solr query only if we are interested in the actual search results
|
||||||
|
|
||||||
// Add any search fields to our query. This is the limited list
|
// Add any search fields to our query. This is the limited list
|
||||||
// of fields that will be returned in the solr result
|
// of fields that will be returned in the solr result
|
||||||
for (String fieldName : discoveryQuery.getSearchFields()) {
|
for (String fieldName : discoveryQuery.getSearchFields()) {
|
||||||
@@ -871,6 +874,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
solrQuery.addField(SearchUtils.RESOURCE_ID_FIELD);
|
solrQuery.addField(SearchUtils.RESOURCE_ID_FIELD);
|
||||||
solrQuery.addField(SearchUtils.RESOURCE_UNIQUE_ID);
|
solrQuery.addField(SearchUtils.RESOURCE_UNIQUE_ID);
|
||||||
solrQuery.addField(STATUS_FIELD);
|
solrQuery.addField(STATUS_FIELD);
|
||||||
|
}
|
||||||
|
|
||||||
if (discoveryQuery.isSpellCheck()) {
|
if (discoveryQuery.isSpellCheck()) {
|
||||||
solrQuery.setParam(SpellingParams.SPELLCHECK_Q, query);
|
solrQuery.setParam(SpellingParams.SPELLCHECK_Q, query);
|
||||||
|
Reference in New Issue
Block a user