Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed elasticsearch with document attachments #118

Open
ocReaper opened this issue Mar 18, 2015 · 2 comments
Open

Feed elasticsearch with document attachments #118

ocReaper opened this issue Mar 18, 2015 · 2 comments

Comments

@ocReaper
Copy link

It could be usefull if we could search in document attachments like pdfs, epubs.
I'm just brainstorming but there is a hook for attachment uploads what you could use.

function add_attachment_to_elastic($results) {
    if( $results['type'] === 'application/pdf' ) {
        $filename = $results[ 'file' ];
        $url = $results[ 'url' ];

        // add attachment to elastic
        // Elastica\Document addFile($key, $filepath, $mimeType = '')
    }
}

add_action('add_attachment', 'add_attachment_to_elastic');
@codelogn
Copy link

Last week, I customized the plugin to support search in documents and posts attachments. I just needed to install mapper type attachment plugin and add similar code.

@ocReaper
Copy link
Author

Thank you for the continuous improvement of the plugin! It's really helpful for us!
Me and the company I work for are looking forward to the next release! 😄
Keep up the good work! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants