funstaff / funstafftikabundle
FunstaffTikaBundle: Wrapper for tika.
Installs: 89
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 3
Type:symfony-bundle
Requires
- php: >=5.3.3
- monolog/monolog: 1.4.*
- symfony/framework-bundle: >=2.0,<2.3-dev
- symfony/monolog-bridge: >=2.0,<2.3-dev
- symfony/security-bundle: >=2.0,<2.3-dev
This package is auto-updated.
Last update: 2024-10-29 04:09:17 UTC
README
This bundle work with Apache Tika.
Configuration
File config.yml
funstaff_tika:
tika_path: /path/to/tika-app-1.0.jar
output_format: ~ # default: xml
output_encoding: ~ # default: UTF-8
logging: ~ # Use the Symfony2 default. Force the logging with this param.
Examples
Extract only the content:
$tika = $this->get('funstaff.tika')
->setOutputFormat('text')
->addDocument('foo', '/path/to/foo')
->extractContent();
Extract Only the metadata
$tika = $this->get('funstaff.tika')
...
->extractMetadata();
Extract content and metadata
$tika = $this->get('funstaff.tika')
...
->extractAll();
Work with data
foreach ($tika->getDocuments() as $document) {
$content = $document->getContent();
$metadata = $document->getMetadata();
$author = $metadata->get('Author');
}
Credits
To all users that gave feedback and committed code https://github.com/Funstaff/FunstaffTikaBundle.