mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.N (5.2.1) to HEAD (5.2)
131292 gjames: SEARCH-195: Implementing hightlighting for the search public API git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@132236 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -43,6 +43,7 @@ import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
import org.alfresco.rest.framework.resource.parameters.Paging;
|
||||
import org.alfresco.rest.framework.resource.parameters.Params;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.GeneralHighlightParameters;
|
||||
import org.alfresco.service.cmr.search.LimitBy;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchParameters.FieldFacet;
|
||||
@@ -102,6 +103,7 @@ public class SearchMapper
|
||||
fromFacetQuery(sp, searchQuery.getFacetQueries());
|
||||
fromFacetFields(sp, searchQuery.getFacetFields());
|
||||
fromSpellCheck(sp, searchQuery.getSpellcheck());
|
||||
fromHighlight(sp, searchQuery.getHighlight());
|
||||
fromScope(sp, searchQuery.getScope());
|
||||
fromLimits(sp, searchQuery.getLimits());
|
||||
|
||||
@@ -426,6 +428,16 @@ public class SearchMapper
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the hightlight object on search parameters
|
||||
* @param sp SearchParameters
|
||||
* @param hightlight GeneralHighlightParameters
|
||||
*/
|
||||
public void fromHighlight(SearchParameters sp, GeneralHighlightParameters hightlight)
|
||||
{
|
||||
sp.setHightlight(hightlight);
|
||||
}
|
||||
|
||||
/**
|
||||
* SearchParameters from the Limits object
|
||||
* @param sp SearchParameters
|
||||
|
@@ -27,7 +27,7 @@
|
||||
package org.alfresco.rest.api.search.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.parameters.Paging;
|
||||
import org.apache.solr.common.params.SpellingParams;
|
||||
import org.alfresco.service.cmr.search.GeneralHighlightParameters;
|
||||
import org.codehaus.jackson.annotate.JsonCreator;
|
||||
import org.codehaus.jackson.annotate.JsonProperty;
|
||||
|
||||
@@ -53,8 +53,9 @@ public class SearchQuery
|
||||
private final Spelling spellcheck;
|
||||
private final Scope scope;
|
||||
private final Limits limits;
|
||||
private final GeneralHighlightParameters highlight;
|
||||
|
||||
public static final SearchQuery EMPTY = new SearchQuery(null, null, null, null, null,null, null, null,null, null, null, null, null);
|
||||
public static final SearchQuery EMPTY = new SearchQuery(null, null, null, null, null,null, null, null,null, null, null, null, null, null);
|
||||
|
||||
@JsonCreator
|
||||
public SearchQuery(@JsonProperty("query") Query query,
|
||||
@@ -69,7 +70,8 @@ public class SearchQuery
|
||||
@JsonProperty("facetQueries") List<FacetQuery> facetQueries,
|
||||
@JsonProperty("spellcheck") Spelling spellcheck,
|
||||
@JsonProperty("scope") Scope scope,
|
||||
@JsonProperty("limits")Limits limits)
|
||||
@JsonProperty("limits")Limits limits,
|
||||
@JsonProperty("highlight")GeneralHighlightParameters highlight)
|
||||
{
|
||||
this.query = query;
|
||||
this.paging = paging;
|
||||
@@ -84,6 +86,7 @@ public class SearchQuery
|
||||
this.scope = scope;
|
||||
this.facetFields = facetFields;
|
||||
this.limits = limits;
|
||||
this.highlight = highlight;
|
||||
}
|
||||
|
||||
public Query getQuery()
|
||||
@@ -145,6 +148,10 @@ public class SearchQuery
|
||||
return facetFields;
|
||||
}
|
||||
|
||||
public GeneralHighlightParameters getHighlight()
|
||||
{
|
||||
return highlight;
|
||||
}
|
||||
public Limits getLimits()
|
||||
{
|
||||
return limits;
|
||||
|
Reference in New Issue
Block a user