nit0906 commented on code in PR #670:
URL: https://github.com/apache/jackrabbit-oak/pull/670#discussion_r948611277
##########
oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/FullTextIndexCommonTest.java:
##########
@@ -62,13 +65,26 @@ public void defaultAnalyzerHonourSplitOptions() throws
Exception {
root.commit();
assertEventually(() -> {
- assertQuery("//*[jcr:contains(@analyzed_field, '1234')] ", XPATH,
Collections.emptyList());
- assertQuery("//*[jcr:contains(@analyzed_field, 'abcd')] ", XPATH,
Collections.emptyList());
- assertQuery("//*[jcr:contains(@analyzed_field, '5678')] ", XPATH,
Collections.emptyList());
- assertQuery("//*[jcr:contains(@analyzed_field, '1234abCd5678')] ",
XPATH, Collections.singletonList("/test/a"));
+ assertQuery("//*[jcr:contains(@analyzed_field, '1234')] ", XPATH,
emptyList());
+ assertQuery("//*[jcr:contains(@analyzed_field, 'abcd')] ", XPATH,
emptyList());
+ assertQuery("//*[jcr:contains(@analyzed_field, '5678')] ", XPATH,
emptyList());
+ assertQuery("//*[jcr:contains(@analyzed_field, '1234abCd5678')] ",
XPATH, singletonList("/test/a"));
});
}
+ @Test
+ public void searchInDateField() throws Exception {
+ Tree test = setup();
+
+ Tree a = test.addChild("a");
+ a.setProperty("analyzed_field", "1234abCd5678");
+ a.setProperty("date_prop", "2014-04-01T09:58:03.231Z", Type.DATE);
+ root.commit();
+
+ assertEventually(() ->
+ assertQuery("//*[jcr:contains(., '01T09')] ", XPATH,
singletonList("/test/a")));
Review Comment:
Can we add one more assertion case where expected result would be 2 nodes -
one satisfied from a date type prop and other from String type.
for example - we add another node test/b with analyzed_field=231Z and then
search on `//*[jcr:contains(., '231Z')`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]