-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/ogc 508 replace elastic search by postgres v2 #1357
base: master
Are you sure you want to change the base?
Feature/ogc 508 replace elastic search by postgres v2 #1357
Conversation
This reverts commit 737fb14.
@@ -67,6 +71,9 @@ def reference(self, request: 'OrgRequest') -> str: | |||
def reference_group(self, request: 'OrgRequest') -> str: | |||
return request.translate(self.group) | |||
|
|||
# FIXME: extra localized text is used for suggestions in the search but | |||
# does not work with the ranking of the search results | |||
# @hybrid_property | |||
@cached_property | |||
def extra_localized_text(self) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra_localized_text
is used for search suggestions but do not work when applying the ranking for search results. I changed to hybrid_property
which throws
File "/home/reto/workspace/onegov-cloud/src/onegov/org/models/ticket.py", line 93, in extra_localized_text
q = object_session(self).query(Message)
^^^^^^^^^^^^^^^^^^^^
File "/home/reto/workspace/onegov-cloud/venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 3464, in object_session
util.raise_(
File "/home/reto/workspace/onegov-cloud/venv/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
sqlalchemy.orm.exc.UnmappedInstanceError: Class 'sqlalchemy.ext.declarative.api.DeclarativeMeta' is not mapped; was a class (onegov.org.models.ticket.FormSubmissionTicket) supplied where an instance was required?
How can I transform it to a hybrid property?
) | ||
# FIXME: sorting by rank_expression does not work | ||
# with OrgTicketMixin::extra_localized_text | ||
# query = query.order_by(rank_expression.desc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the counter part of the issue described in the above comment.
Please fill in the commit message below and work through the checklist. You can delete parts that are not needed, e.g. the optional description, the link to a ticket or irrelevant options of the checklist.
Commit message
:
TYPE: <Feature|Bugfix>
LINK:
HINT:
Checklist