Having trouble storing attachments. What am I doing wrong?

I've been trying to get attachments to store for days now, and I can't seem
to get it to work. I've tried a number of different solutions, and I can't
seem to get anything to work, so I'm hoping someone here can point me in
the right direction.

I'm using ES .20.5 with the latest attachment plugin. This is my mapping:

pcc_doc: {

  • _boost: {
    • null_value: 1
      }
  • properties: {
    • content: {
      • path: full
      • type: attachment
      • fields: {
        • content: {
          • type: string
            }
        • author: {
          • type: string
            }
        • title: {
          • analyzer: english
          • type: string
            }
        • keywords: {
          • store: yes
          • analyzer: keyword
          • type: string
            }
        • name: {
          • type: string
            }
        • date: {
          • format: dateOptionalTime
          • type: date
            }
        • content_type: {
          • type: string
            }
            }
            }

I'm using Elastica to store the document (in this case a PDF) and my code
looks like this:

$elasticaClient = new \Elastica\Client();
$elasticaIndex = $elasticaClient->getIndex($company);
$elasticaType = $elasticaIndex->getType($category);
$researchDocument = new \Elastica\Document();
$researchDocument->addFileContent('content', file_get_contents($path));
// Add to type
$elasticaType->addDocument($researchDocument);

// Refresh Index
$elasticaType->getIndex()->refresh();

Upon successful submit, I see one document inserted, and the content field
is filled with a string of jibberish (
JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGF) <-- is a small
paste of what is in the field I try to do a search on the type for the text
that I know is in the PDF, but ES returns the message: curl: (52) Empty
reply from server

I was under the impression that if I provided for those other fields, the
attachment plugin would fill them in automatically.

Can anyone see something wrong in what I'm doing? I'm really stuck here.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Can you post your search request?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 18 mai 2013 à 22:42, Andrew Soep siraris@gmail.com a écrit :

I've been trying to get attachments to store for days now, and I can't seem to get it to work. I've tried a number of different solutions, and I can't seem to get anything to work, so I'm hoping someone here can point me in the right direction.

I'm using ES .20.5 with the latest attachment plugin. This is my mapping:

pcc_doc: {
_boost: {
null_value: 1
}
properties: {
content: {
path: full
type: attachment
fields: {
content: {
type: string
}
author: {
type: string
}
title: {
analyzer: english
type: string
}
keywords: {
store: yes
analyzer: keyword
type: string
}
name: {
type: string
}
date: {
format: dateOptionalTime
type: date
}
content_type: {
type: string
}
}
}

I'm using Elastica to store the document (in this case a PDF) and my code looks like this:

$elasticaClient = new \Elastica\Client();
$elasticaIndex = $elasticaClient->getIndex($company);

	$elasticaType = $elasticaIndex->getType($category);
	
	$researchDocument = new \Elastica\Document();
	$researchDocument->addFileContent('content', file_get_contents($path));
	
	// Add to type
	$elasticaType->addDocument($researchDocument);

	// Refresh Index
	$elasticaType->getIndex()->refresh();

Upon successful submit, I see one document inserted, and the content field is filled with a string of jibberish (JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGF) <-- is a small paste of what is in the field I try to do a search on the type for the text that I know is in the PDF, but ES returns the message: curl: (52) Empty reply from server

I was under the impression that if I provided for those other fields, the attachment plugin would fill them in automatically.

Can anyone see something wrong in what I'm doing? I'm really stuck here.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.