manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1444989 - /manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
Date Mon, 11 Feb 2013 22:48:42 GMT
Author: kwright
Date: Mon Feb 11 22:48:42 2013
New Revision: 1444989

URL: http://svn.apache.org/r1444989
Log:
Add ElasticSearch support for file name and content type.  Part of CONNECTORS-641.

Modified:
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java?rev=1444989&r1=1444988&r2=1444989&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
Mon Feb 11 22:48:42 2013
@@ -118,6 +118,12 @@ public class ElasticSearchIndex extends 
             pw.print(",");
           }
           pw.print("\"type\" : \"attachment\",");
+          String contentType = document.getMimeType();
+          if (contentType != null)
+            pw.print("\"_content_type\" : "+jsonStringEscape(contentType));
+          String fileName = document.getFileName();
+          if (fileName != null)
+            pw.print("\"_name\" : "+jsonStringEscape(fileName));
           pw.print("\"file\" : \"");
           Base64 base64 = new Base64();
           base64.encodeStream(inputStream, pw);



Mime
View raw message