/** * Gets the raw sort field, as it will be sent to Solr. * <p> * The returned sort field will always contain a serialized version * of the sort string built using {@link #setSort(SortClause)}, * {@link #addSort(SortClause)}, {@link #addOrUpdateSort(SortClause)}, * {@link #removeSort(SortClause)}, {@link #clearSorts()} and * {@link #setSorts(List)}. */ public String getSortField() { return this.get(CommonParams.SORT); }
/** get facet sort * * @return facet sort or default of {@link FacetParams#FACET_SORT_COUNT} */ public String getFacetSortString() { return this.get(FacetParams.FACET_SORT, FacetParams.FACET_SORT_COUNT); }
/** * Gets the query fields and their boosts. */ public String getMoreLikeThisQF() { return this.get(MoreLikeThisParams.QF); }
/** get facet sort * * @return facet sort or default of {@link FacetParams#FACET_SORT_COUNT} */ public String getFacetSortString() { return this.get(FacetParams.FACET_SORT, FacetParams.FACET_SORT_COUNT); }
/** get facet sort * * @return facet sort or default of {@link FacetParams#FACET_SORT_COUNT} */ public String getFacetSortString() { return this.get(FacetParams.FACET_SORT, FacetParams.FACET_SORT_COUNT); }
/** * Gets the raw sort field, as it will be sent to Solr. * <p> * The returned sort field will always contain a serialized version * of the sort string built using {@link #setSort(SortClause)}, * {@link #addSort(SortClause)}, {@link #addOrUpdateSort(SortClause)}, * {@link #removeSort(SortClause)}, {@link #clearSorts()} and * {@link #setSorts(List)}. */ public String getSortField() { return this.get(CommonParams.SORT); }
public String getHighlightSimplePost() { return this.get(HighlightParams.SIMPLE_POST, ""); }
public String getFields() { String fields = this.get(CommonParams.FL); if (fields!=null && fields.equals("score")) { fields = "*, score"; } return fields; }
public String getFields() { String fields = this.get(CommonParams.FL); if (fields!=null && fields.equals("score")) { fields = "*, score"; } return fields; }
/** * @return an array with the fields used to compute similarity. */ public String[] getMoreLikeThisFields() { String fl = this.get(MoreLikeThisParams.SIMILARITY_FIELDS); if(fl==null || fl.length()==0) { return null; } return fl.split(","); }
/** remove a facet query * * @param q the facet query to remove * @return true if the facet query was removed false otherwise */ public boolean removeFacetQuery(String q) { boolean b = this.remove(FacetParams.FACET_QUERY, q); if (this.get(FacetParams.FACET_FIELD) == null && this.get(FacetParams.FACET_QUERY) == null) { this.setFacet(false); } return b; }
/** remove a facet query * * @param q the facet query to remove * @return true if the facet query was removed false otherwise */ public boolean removeFacetQuery(String q) { boolean b = this.remove(FacetParams.FACET_QUERY, q); if (this.get(FacetParams.FACET_FIELD) == null && this.get(FacetParams.FACET_QUERY) == null) { this.setFacet(false); } return b; }
/** remove a facet query * * @param q the facet query to remove * @return true if the facet query was removed false otherwise */ public boolean removeFacetQuery(String q) { boolean b = this.remove(FacetParams.FACET_QUERY, q); if (this.get(FacetParams.FACET_FIELD) == null && this.get(FacetParams.FACET_QUERY) == null) { this.setFacet(false); } return b; }
public SolrQuery setIncludeScore(boolean includeScore) { String fields = get(CommonParams.FL,"*"); if (includeScore) { if (!scorePattern.matcher(fields).find()) { this.set(CommonParams.FL, fields+",score"); } } else { this.set(CommonParams.FL, scorePattern.matcher(fields).replaceAll("")); } return this; }
private SolrQuery addValueToParam(String name, String value) { String tmp = this.get(name); tmp = join(tmp, value, ","); this.set(name, tmp); return this; }
public SolrQuery removeSortField(String field, ORDER order) { String s = this.get(CommonParams.SORT); String removeSort = toSortString(field, order); if (s != null) { String[] sorts = s.split(","); s = join(sorts, ", ", removeSort); if (s.length()==0) s=null; this.set(CommonParams.SORT, s); } return this; }
private SolrQuery addValueToParam(String name, String value) { String tmp = this.get(name); tmp = join(tmp, value, ","); this.set(name, tmp); return this; }
/** remove a field for highlighting * * @param f field name to not highlight * @return <i>true</i>, if removed, <br> <i>false</i>, otherwise */ public boolean removeHighlightField(String f) { boolean b = this.remove(HighlightParams.FIELDS, f); if (this.get(HighlightParams.FIELDS) == null) { this.setHighlight(false); } return b; }
/** remove a field for highlighting * * @param f field name to not highlight * @return <i>true</i>, if removed, <br /> <i>false</i>, otherwise */ public boolean removeHighlightField(String f) { boolean b = this.remove(HighlightParams.FIELDS, f); if (this.get(HighlightParams.FIELDS) == null) { this.setHighlight(false); } return b; }
private SolrQuery addValueToParam(String name, String value) { String tmp = this.get(name); tmp = join(tmp, value, ","); this.set(name, tmp); return this; }