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

[ADD] attachment_unindex_content: Disable the indexation of files #1713

Merged

Conversation

ebirbe
Copy link
Contributor

@ebirbe ebirbe commented Oct 30, 2019

This module is intended to disable the indexation of data on the ir.attachment model.

Attachment model has a field called 'index_content' where the content of the attachment is read and stored directly in the database. This field is useful in order to search content of a file. But most of cases it is not used, so, you can install this module in order to:

  • Avoid Duplicating Data: Because indexation extracts text content from files and put it on the database in order it could be searched, but this implies you have the file data in your filestore directory, and also part (or sometimes all) of that data in your database too.
  • Improve Performance: Since not all indexed files are plain text, they require extra process to read them.

Maybe you could try to uninstall modules like document in order to disable its indexation features, but you could face the uninstallation of other modules that could be useful for you (e.g, hr_recruitment` depends on that).

But even if you don't have document installed, you'd still have plain text content indexation by default.

Using this module you will not require to uninstall any module to disable the attachment content indexation, because we directly disable it at ir.attachment base.

/cc @moylop260

@oca-clabot
Copy link

Hey @ebirbe, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

  • @ebirbe (login unknown in OCA database)

Appreciation of efforts,
OCA CLAbot

@OCA-git-bot
Copy link
Contributor

Hi @moylop260, @ebirbe,
some modules you are maintaining are being modified, check this out!

Copy link
Contributor

@moylop260 moylop260 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@moylop260 moylop260 changed the title [ADD] attachment_unindex_content: New Module [ADD] attachment_unindex_content: Disable the indexation of files Oct 30, 2019
@pedrobaeza
Copy link
Member

Isn't the indexation done by document module and you only need to not install it?

@ebirbe
Copy link
Contributor Author

ebirbe commented Oct 30, 2019

Isn't the indexation done by document module and you only need to not install it?

Hello @pedrobaeza the indexation is being called directly from the base module. It will occur even if we do not install document.

This is a query over a database without document module installed:

Área de trabajo 1_750

The document module only adds indexation for additional file formats.

Adittionally, there will be cases were you will want to have this feature of no indexation, but without uninstalling another modules that depends on document. That's the case of hr_recruitment for example.

So, this module disables indexation directly from the base, and without having to lose other functionalities.

@pedrobaeza
Copy link
Member

Thanks for the explanations. I think they are very interesting to be added to the README as well.

This module is intended to disable the indexation of data on the
ir.attachment model.

Attachment model has a field called 'index_content' where the content
of the attachment is read and stored directly in the database. This field is
useful in order to search content of a file. But most of cases it is not used,
so, you can install this module in order to:

- **Avoid Duplicating Data:** Because indexation extracts text content
from files and put it on the database in order it could be searched, but
this implies you have the file data in your `filestore` directory, and
also part (or sometimes all) of that data in your database too.
- **Improve Performance:** Since not all indexed files are plain text, they
require extra process to read them.

Maybe you could try to uninstall modules like `document` in order to
disable its indexation features, but you could face the uninstallation of other
modules that could be useful for you (e.g, `hr_recruitment` depends on that).

But even if you don't have `document` installed, you'd still have
plain text content indexation by default.

Using this module you will not require to uninstall any module to
disable the attachment content indexation, because we directly disable it at
`ir.attachment` base.
@ebirbe ebirbe force-pushed the 12.0-oca_attachment_unindex_content-ebirbe branch from fc1329d to 0c2c386 Compare October 30, 2019 22:45
@ebirbe
Copy link
Contributor Author

ebirbe commented Oct 30, 2019

I think they are very interesting to be added to the README as well.

Thank you, I've updated the documentation.

@moylop260
Copy link
Contributor

@pedrobaeza
Do you have any new comment?

@moylop260
Copy link
Contributor

Thanks for review @guewen and @pedrobaeza

/ocabot merge

Since that it has the approved tag

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 12.0-ocabot-merge-pr-1713-by-moylop260-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 1, 2019
Signed-off-by moylop260
@OCA-git-bot OCA-git-bot merged commit 0c2c386 into OCA:12.0 Nov 1, 2019
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at e02d8d2. Thanks a lot for contributing to OCA. ❤️

@moylop260 moylop260 deleted the 12.0-oca_attachment_unindex_content-ebirbe branch November 1, 2019 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants