1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-20 13:11:41 +00:00

Add custom parameter for exact search by title

This commit is contained in:
Julien Kirch
2021-10-12 13:50:32 +02:00
committed by GitHub
parent b0d0e93364
commit d98c1bddec
4 changed files with 26 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ public class DocumentCriteria {
private List<List<String>> tagIdList;
/**
* Tag IDs to excluded.
* Tag IDs to exclude.
* The first and second level list will be excluded.
*/
private List<List<String>> excludedTagIdList;
@@ -81,7 +81,12 @@ public class DocumentCriteria {
* MIME type of a file.
*/
private String mimeType;
/**
* The title.
*/
private String title;
public List<String> getTargetIdList() {
return targetIdList;
}
@@ -194,4 +199,12 @@ public class DocumentCriteria {
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}

View File

@@ -295,6 +295,10 @@ public class LuceneIndexingHandler implements IndexingHandler {
criteriaList.add("d.DOC_UPDATEDATE_D <= :updateDateMax");
parameterMap.put("updateDateMax", criteria.getUpdateDateMax());
}
if (criteria.getTitle() != null) {
criteriaList.add("d.DOC_TITLE_C = :title");
parameterMap.put("title", criteria.getTitle());
}
if (criteria.getTagIdList() != null && !criteria.getTagIdList().isEmpty()) {
int index = 0;
for (List<String> tagIdList : criteria.getTagIdList()) {