Skip to content

Commit

Permalink
Changed text solr field to text sorted (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosjepard authored Jan 13, 2025
1 parent 2164f82 commit 4667e26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ public class ViewerConstants {
public static final String SOLR_DYN_LOCATION_RPT = "_srpt";
public static final String SOLR_DYN_LONG = "_l";
public static final String SOLR_DYN_STRING = "_s";
public static final String SOLR_DYN_TEXT_GENERAL = "_t";
public static final String SOLR_DYN_TEXT_MULTI = "_txt";
public static final String SOLR_DYN_TEXT_GENERAL = "_t_sort";
public static final String SOLR_DYN_TEXT_MULTI = "_txt_sort";
public static final String SOLR_DYN_NEST_MULTI = "_nst";
public static final String SOLR_DYN_MIMETYPE = "_mimetype";
public static final String SOLR_DYN_FILE_EXTENSION = "_fileExtension";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
import org.roda.core.data.exceptions.NotFoundException;
import org.roda.core.data.exceptions.RequestNotValidException;

import com.databasepreservation.common.server.index.utils.SolrUtils;
import com.databasepreservation.common.client.ViewerConstants;
import com.databasepreservation.common.client.index.IsIndexed;
import com.databasepreservation.common.exceptions.ViewerException;
import com.databasepreservation.common.server.index.utils.SolrUtils;

public abstract class AbstractSolrCollection<M extends IsIndexed> implements SolrCollection<M> {

Expand All @@ -40,8 +41,10 @@ public List<Field> getFields() {
public List<DynamicField> getDynamicFields() {
List<DynamicField> ret = new ArrayList<>();

ret.add(new DynamicField("*_txt", Field.TYPE_TEXT).setIndexed(true).setStored(true).setMultiValued(true));
ret.add(new DynamicField("*_nst", Field.TYPE_TEXT).setIndexed(false).setStored(false).setMultiValued(true));
ret.add(new DynamicField("*" + ViewerConstants.SOLR_DYN_TEXT_MULTI, Field.TYPE_TEXT).setIndexed(true)
.setStored(true).setMultiValued(true));
ret.add(new DynamicField("*" + ViewerConstants.SOLR_DYN_NEST_MULTI, Field.TYPE_TEXT).setIndexed(false)
.setStored(false).setMultiValued(true));

return ret;
}
Expand Down

0 comments on commit 4667e26

Please sign in to comment.