mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
#336: fix search by type
This commit is contained in:
parent
4c7f3166d4
commit
5f4a6bc462
@ -325,7 +325,8 @@ public class LuceneIndexingHandler implements IndexingHandler {
|
|||||||
criteriaList.add("s.count > 0");
|
criteriaList.add("s.count > 0");
|
||||||
}
|
}
|
||||||
if (criteria.getMimeType() != null) {
|
if (criteria.getMimeType() != null) {
|
||||||
sb.append("left join T_FILE f0 on f0.FIL_IDDOC_C = d.DOC_ID_C and f0.FIL_DELETEDATE_D is null");
|
sb.append("left join T_FILE f0 on f0.FIL_IDDOC_C = d.DOC_ID_C and f0.FIL_MIMETYPE_C = :mimeType and f0.FIL_DELETEDATE_D is null");
|
||||||
|
parameterMap.put("mimeType", criteria.getMimeType());
|
||||||
criteriaList.add("f0.FIL_ID_C is not null");
|
criteriaList.add("f0.FIL_ID_C is not null");
|
||||||
}
|
}
|
||||||
if (criteria.getLanguage() != null) {
|
if (criteria.getLanguage() != null) {
|
||||||
|
@ -215,6 +215,7 @@ public class TestDocumentResource extends BaseJerseyTest {
|
|||||||
Assert.assertEquals(1, searchDocuments("shared:yes", document1Token));
|
Assert.assertEquals(1, searchDocuments("shared:yes", document1Token));
|
||||||
Assert.assertEquals(2, searchDocuments("lang:eng", document1Token));
|
Assert.assertEquals(2, searchDocuments("lang:eng", document1Token));
|
||||||
Assert.assertEquals(1, searchDocuments("mime:image/png", document1Token));
|
Assert.assertEquals(1, searchDocuments("mime:image/png", document1Token));
|
||||||
|
Assert.assertEquals(0, searchDocuments("mime:empty/void", document1Token));
|
||||||
Assert.assertEquals(1, searchDocuments("after:2010 before:2040-08 tag:super shared:yes lang:eng title description full:uranium", document1Token));
|
Assert.assertEquals(1, searchDocuments("after:2010 before:2040-08 tag:super shared:yes lang:eng title description full:uranium", document1Token));
|
||||||
|
|
||||||
// Search documents (nothing)
|
// Search documents (nothing)
|
||||||
|
Loading…
Reference in New Issue
Block a user