cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: CXF-5923: Create sample to demonstrate usage of search extension with Lucene and Tika. Added OpenDocument support.
Date Mon, 29 Sep 2014 00:21:50 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 99963f9a0 -> 665eb259f


CXF-5923: Create sample to demonstrate usage of search extension with Lucene and Tika. Added
OpenDocument support.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/665eb259
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/665eb259
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/665eb259

Branch: refs/heads/master
Commit: 665eb259fced741f65de061bb026c3ab65a8d99c
Parents: 99963f9
Author: reta <drreta@gmail.com>
Authored: Sun Sep 28 20:21:40 2014 -0400
Committer: reta <drreta@gmail.com>
Committed: Sun Sep 28 20:21:40 2014 -0400

----------------------------------------------------------------------
 .../main/java/demo/jaxrs/search/client/Client.java  |   4 +++-
 .../main/java/demo/jaxrs/search/server/Catalog.java |   7 ++++++-
 .../src/main/resources/apache-cxf-tika-lucene.odt   | Bin 0 -> 4250 bytes
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/665eb259/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/client/Client.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/client/Client.java
b/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/client/Client.java
index c126630..72ff45f 100644
--- a/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/client/Client.java
+++ b/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/client/Client.java
@@ -41,7 +41,8 @@ public final class Client {
         final HttpClient httpClient = new HttpClient();
                         
         uploadToCatalog(url, httpClient, "jsr339-jaxrs-2.0-final-spec.pdf");
-        uploadToCatalog(url, httpClient, "JavaWebSocketAPI_1.0_Final.pdf");             

+        uploadToCatalog(url, httpClient, "JavaWebSocketAPI_1.0_Final.pdf");
+        uploadToCatalog(url, httpClient, "apache-cxf-tika-lucene.odt");
         
         list(url, httpClient);        
         
@@ -52,6 +53,7 @@ public final class Client {
         search(url, httpClient, "ct==WebSockets");
         
         search(url, httpClient, "ct==jaxrs,source==*jaxrs*");
+        search(url, httpClient, "ct==tika");
         
         delete(url, httpClient);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/665eb259/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
b/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
index 8707ed8..1f66ecb 100644
--- a/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
+++ b/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
@@ -26,6 +26,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -82,11 +83,15 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.Version;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.parser.odf.OpenDocumentParser;
 import org.apache.tika.parser.pdf.PDFParser;
 
 @Path("/catalog")
 public class Catalog {
-    private final TikaLuceneContentExtractor extractor = new TikaLuceneContentExtractor(new
PDFParser());    
+    private final TikaLuceneContentExtractor extractor = new TikaLuceneContentExtractor(
+        Arrays.< Parser >asList(new PDFParser(), new OpenDocumentParser()), 
+        new LuceneDocumentMetadata());    
     private final Directory directory = new RAMDirectory();
     private final Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_4_9);    
     private final Storage storage; 

http://git-wip-us.apache.org/repos/asf/cxf/blob/665eb259/distribution/src/main/release/samples/jax_rs/search/src/main/resources/apache-cxf-tika-lucene.odt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/search/src/main/resources/apache-cxf-tika-lucene.odt
b/distribution/src/main/release/samples/jax_rs/search/src/main/resources/apache-cxf-tika-lucene.odt
new file mode 100644
index 0000000..23c7978
Binary files /dev/null and b/distribution/src/main/release/samples/jax_rs/search/src/main/resources/apache-cxf-tika-lucene.odt
differ


Mime
View raw message