Skip to content

Apache Lucene open-source search software

SOLR-1318: Added ICU4J to extraction and test for Arabic

Grant Ingersollca50eef4ca05
diff --git a/contrib/extraction/CHANGES.txt b/contrib/extraction/CHANGES.txt
index d72ab34a84a..ae57d3bdc0c 100644
--- a/contrib/extraction/CHANGES.txt
+++ b/contrib/extraction/CHANGES.txt
@@ -29,6 +29,7 @@ $Id:$
* SOLR-1738: Upgrade to Tika 0.6 (gsingers)
+* SOLR-18913: Add ICU4j to libs and add tests for Arabic extraction (Robert Muir via gsingers)
================== Release 1.4.0 ==================
diff --git a/contrib/extraction/lib/icu4j-4_2_1.jar b/contrib/extraction/lib/icu4j-4_2_1.jar
new file mode 100644
index 00000000000..8053ea3e88c
--- /dev/null
+++ b/contrib/extraction/lib/icu4j-4_2_1.jar
@@ -0,0 +1,2 @@
+AnyObjectId[bf0d532cb19e6ce3972f370a13a1940d1a8d1db8] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file
diff --git a/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java b/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java
index 3a6893e201a..0ce7abae2ac 100644
--- a/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java
+++ b/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java
@@ -322,6 +322,22 @@ public class ExtractingRequestHandlerTest extends AbstractSolrTestCase {
assertTrue(val + " is not equal to " + "linkNews", val.equals("linkNews") == true);//there are two <a> tags, and they get collapesd
}
+ /** test arabic PDF extraction is functional */
+ public void testArabicPDF() throws Exception {
+ ExtractingRequestHandler handler = (ExtractingRequestHandler)
+ h.getCore().getRequestHandler("/update/extract");
+ assertTrue("handler is null and it shouldn't be", handler != null);
+
+ loadLocal("arabic.pdf", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer",
+ "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords",
+ "fmap.Author", "extractedAuthor",
+ "fmap.content", "wdf_nocase",
+ "literal.id", "one",
+ "fmap.Last-Modified", "extractedDate");
+ assertQ(req("wdf_nocase:السلم"), "//result[@numFound=0]");
+ assertU(commit());
+ assertQ(req("wdf_nocase:السلم"), "//result[@numFound=1]");
+ }
SolrQueryResponse loadLocal(String filename, String... args) throws Exception {
LocalSolrQueryRequest req = (LocalSolrQueryRequest) req(args);
diff --git a/contrib/extraction/src/test/resources/arabic.pdf b/contrib/extraction/src/test/resources/arabic.pdf
new file mode 100644
index 00000000000..3d47b999d5e
Binary files /dev/null and b/contrib/extraction/src/test/resources/arabic.pdf differ