Skip to content

[16.0][ADD] Connector typesense#168

Closed
MrTango wants to merge 11 commits into
OCA:16.0from
derico-de:connector_typesense
Closed

[16.0][ADD] Connector typesense#168
MrTango wants to merge 11 commits into
OCA:16.0from
derico-de:connector_typesense

Conversation

@MrTango
Copy link
Copy Markdown
Contributor

@MrTango MrTango commented Nov 8, 2023

This is now fully working implementation of the Typesense backend.
Typesence is a free API compatible alternative to Algolia and easier to use than Elastic Search or Solr.

  • Functional implementation of Typesense backend
  • Add tests
  • Finish documentation

@sebastienbeau this needs the other two (#166 #167) PR's merged.

@MrTango MrTango marked this pull request as draft November 8, 2023 12:21
@MrTango MrTango force-pushed the connector_typesense branch 2 times, most recently from 0d1c09b to 315789c Compare November 8, 2023 12:39
@MrTango MrTango changed the title Connector typesense [16.0][ADD] Connector typesense Nov 8, 2023
@MrTango MrTango force-pushed the connector_typesense branch from 2bb016c to aad62fa Compare November 10, 2023 16:44
@MrTango MrTango marked this pull request as ready for review January 9, 2024 11:05
@MrTango
Copy link
Copy Markdown
Contributor Author

MrTango commented Jan 9, 2024

@sebastienbeau @simahawk @lmignon i would be happy to here some feedback from you.
Also please check if the readme stuff is correct, as I'm not quite sure if i understand how this in build together.

Copy link
Copy Markdown
Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

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

Thank you @MrTango for this contribution. I'd like to propose a first series of comments, but this seems to be going in the right direction. Great to have a new implementation for this new search engine which looks very interesting.

Comment thread connector_typesense/models/ts_backend.py Outdated
Comment thread connector_typesense/models/ts_backend.py
Comment thread connector_typesense/models/ts_index.py Outdated
Comment thread connector_typesense/models/ts_backend.py Outdated
Comment thread connector_typesense/models/ts_index.py Outdated

setuptools.setup(
setup_requires=['setuptools-odoo'],
setup_requires=["setuptools-odoo"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file should not be modified.


setuptools.setup(
setup_requires=['setuptools-odoo'],
setup_requires=["setuptools-odoo"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file should not be modified.


setuptools.setup(
setup_requires=['setuptools-odoo'],
setup_requires=["setuptools-odoo"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file should not be modified.


setuptools.setup(
setup_requires=['setuptools-odoo'],
setup_requires=["setuptools-odoo"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file should not be modified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure this came from the pre-commit command, is there something wrong in the config than?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lmignon did i run the pre-commit command in a wrong way or how can i run just on the module I'm working on?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MrTango If it's changed by pre-commit you can ignore my comments


setuptools.setup(
setup_requires=['setuptools-odoo'],
setup_requires=["setuptools-odoo"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file should not be modified.

@MrTango
Copy link
Copy Markdown
Contributor Author

MrTango commented Jan 9, 2024

thx @lmignon for your commends, I'll have a look at them.
One thing which is not clear to me is, how a can control the json data which is given to the connector.
I only see something like this there, no matter what product config i have:

{
    "id": 7,
    "name": "Office Design Software"
}

I would like to export more details of a product.
Any hints how to do that?
@simahawk @sebastienbeau

@lmignon
Copy link
Copy Markdown
Contributor

lmignon commented Jan 10, 2024

thx @lmignon for your commends, I'll have a look at them. One thing which is not clear to me is, how a can control the json data which is given to the connector. I only see something like this there, no matter what product config i have:

{
    "id": 7,
    "name": "Office Design Software"
}

I would like to export more details of a product. Any hints how to do that? @simahawk @sebastienbeau

The transformation to json is the responsibility of the serializer configured on your index. You can register your specific serializer. For example into the shoinvader project the shopinvader_search_engine addon defines specific serializer for products and categories based on pydantic schema. (https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_search_engine). You can also uses a generic serializer provided by https://github.com/OCA/search-engine/tree/16.0/connector_search_engine_serializer_ir_export and using the ir.exports rules to serialize records to json.

@MrTango
Copy link
Copy Markdown
Contributor Author

MrTango commented Jan 13, 2024

thx for the tips, i found now also that it is using ir.export model and i can define the fields for the model there.

@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 19, 2024
@MrTango
Copy link
Copy Markdown
Contributor Author

MrTango commented May 20, 2024

Sorry for the delay, i'll continue to work on this next month.

@lmignon lmignon added no stale Use this label to prevent the automated stale action from closing this PR/Issue. and removed stale PR/Issue without recent activity, it'll be soon closed automatically. labels May 21, 2024
@MrTango MrTango force-pushed the connector_typesense branch from 970c156 to 4ceaebd Compare October 1, 2024 13:58
@sebastienbeau sebastienbeau added this to the 16.0 milestone Apr 3, 2025
@kobros-tech
Copy link
Copy Markdown
Contributor

@lmignon
@MrTango

How are things? If someone is busy I can help to add my upades here in the source branch for author or ceare a new active PR if the autor is busy to review.

I am really interested in connecting odoo with typesense.

Comment on lines +222 to +223
print(">>> run _jobify_batch_recompute")
# breakpoint()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

print and debug statements must be removed

Comment on lines +34 to +42
api_key_id = fields.Char(
help="Typesense Api Key ID",
string="Api Key ID",
groups="connector_search_engine.group_connector_search_engine_manager",
)
api_key = fields.Char(
help="Typesense Api Key",
groups="connector_search_engine.group_connector_search_engine_manager",
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer to have these fields prefixed with TS

def _get_adapter_class(self):
if self.backend_type == "typesense":
return TypesenseAdapter
else:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

else is not necessary

@@ -0,0 +1,37 @@
Changelog
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ping

@lmignon
Copy link
Copy Markdown
Contributor

lmignon commented Apr 14, 2025

@kobros-tech A lot of comments are not addressed. I'll be happy to merge this new connector but the code should be finalized. Feel free to make a new PR based on this one to complete the work.

@kobros-tech
Copy link
Copy Markdown
Contributor

@kobros-tech A lot of comments are not addressed. I'll be happy to merge this new connector but the code should be finalized. Feel free to make a new PR based on this one to complete the work.

thanks, I did yesterday and I am working on it.
will improve and make professional.

@MrTango
Copy link
Copy Markdown
Contributor Author

MrTango commented Apr 17, 2025

@kobros-tech good to see your interest. I was hoping to work on it on the sprint, which was planned beginning of the year, but that didn't happen. @sebastienbeau any plans for a new date on that?
@kobros-tech let me know if you need anything or want to discuss something ;)

@sebastienbeau sebastienbeau mentioned this pull request Jun 4, 2025
1 task
@sebastienbeau
Copy link
Copy Markdown
Member

Replaced by : #210

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

Labels

no stale Use this label to prevent the automated stale action from closing this PR/Issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants