You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2014/06/27 17:48:45 UTC
[2/2] git commit: [CXF-5549] Moving Lucene DocumentMetadata to its
own class and supporting injecting it via the constructor as discussed with
Andriy, updating TikaContentExtractor to accept multile parsers
[CXF-5549] Moving Lucene DocumentMetadata to its own class and supporting injecting it via the constructor as discussed with Andriy, updating TikaContentExtractor to accept multile parsers
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/785c0bd7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/785c0bd7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/785c0bd7
Branch: refs/heads/master
Commit: 785c0bd70d69a279e73360dc2f3b19ae0101fb93
Parents: 8f99f30
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Fri Jun 27 16:48:17 2014 +0100
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Fri Jun 27 16:48:17 2014 +0100
----------------------------------------------------------------------
.../ext/search/tika/LuceneDocumentMetadata.java | 55 ++++++++++++++++++++
1 file changed, 55 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/785c0bd7/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/tika/LuceneDocumentMetadata.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/tika/LuceneDocumentMetadata.java b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/tika/LuceneDocumentMetadata.java
new file mode 100644
index 0000000..d44ab25
--- /dev/null
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/tika/LuceneDocumentMetadata.java
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.ext.search.tika;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class LuceneDocumentMetadata {
+ private final Map< String, Class< ? > > fieldTypes;
+ private final String contentFieldName;
+
+ public LuceneDocumentMetadata() {
+ this("contents");
+ }
+ public LuceneDocumentMetadata(final String contentFieldName) {
+ this(contentFieldName, new LinkedHashMap< String, Class< ? > >());
+ }
+ public LuceneDocumentMetadata(final Map< String, Class< ? > > fieldTypes) {
+ this("contents", fieldTypes);
+ }
+ public LuceneDocumentMetadata(final String contentFieldName, final Map< String, Class< ? > > fieldTypes) {
+ this.contentFieldName = contentFieldName;
+ this.fieldTypes = fieldTypes;
+ }
+
+ public LuceneDocumentMetadata withField(final String name, final Class< ? > type) {
+ fieldTypes.put(name, type);
+ return this;
+ }
+
+ public String getContentFieldName() {
+ return contentFieldName;
+ }
+ public Class<?> getFieldType(String name) {
+ return fieldTypes.get(name);
+ }
+
+
+}