-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/ogc 508 replace elastic search by postgres text search #918
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
Open
Tschuppi81
wants to merge
207
commits into
master
Choose a base branch
from
feature/ogc-508-replace-elastic-search-by-postgres-text-search
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 188 commits
Commits
Show all changes
207 commits
Select commit
Hold shift + click to select a range
759e4e3
Adding psql index columns and re-index functionality for users and at…
Tschuppi81 0c4159a
Disable ES, make user search working using postgresql
Tschuppi81 5e89675
Adding fts index functions to create, drop index as well as db upgrad…
Tschuppi81 4ad864e
Adding fts index functions to create, drop index as well as db upgrad…
Tschuppi81 8fcf1e9
Switch from ES app to psql app
Tschuppi81 b208736
Switch from ES app to psql app
Tschuppi81 41f3111
Initial move from es to psql search for town6
Tschuppi81 942141c
Core: Fix a lot bugbear warnings.
msom db272dc
Org: Prioritize Events in search, and sort chronologically.
cyrillkuettel 128e988
Core: Enable flake8 bugbear.
msom fcd44b3
agency: Adding many more fields for agencies and people
Tschuppi81 80c09c6
Release release-2023.15
cyrillkuettel 85b7f7e
Town6: Small Fixes
BreathingFlesh de479b1
Feriennet: New banners and logo
BreathingFlesh 0d5fdcd
Town6: Make color inversion on icon links possible
BreathingFlesh 60b8a6a
Feriennet: E-mail notifications on registration for activity
BreathingFlesh a729ec6
Org: Add more options to "further information" on directories
BreathingFlesh a77bf28
Town6: External event url
BreathingFlesh 1ef6587
Feriennet: Invoice Items payment with dates
BreathingFlesh 6d32013
Release release-2023.16
cyrillkuettel a710d57
Town6: Fixes news not being displayed if it's the first item.
cyrillkuettel 81b1563
Town6: Remove "Onegov Cloud Team" in mail-footer
BreathingFlesh 8ae0716
Feriennet: Edit email text
BreathingFlesh a582271
Release release-2023.17
BreathingFlesh 0995031
Town6: Make image preview visible
BreathingFlesh 29e4b5e
Feriennet: Make form more robust if field is missing
cyrillkuettel 48e39a5
Release release-2023.18
BreathingFlesh cefd094
Ballot: Fixes file constraints.
msom fb6f106
Release release-2023.19
44513c9
Org: Small Adjustments
BreathingFlesh d82dd5c
Town6: Add option for a testimonial slider
BreathingFlesh 53a6af9
Core: Indicate hash useage.
msom 0a10833
Form: Add security hint for yaml loading.
msom 7842724
Core: Validate URL used in PostThread.
msom 5df2a27
Core: Add requests timeouts.
msom cf76426
Feriennet: Edit email text
BreathingFlesh 310b7f8
Org: Minor code improvement
Tschuppi81 e1bae14
Core: Pin reportlab.
0d5e4b6
Org: Indent check only activated for new and edit forms but not for d…
Tschuppi81 9f92a4d
Town6: Fixes E-mail template
treinhard 87a09c5
Swissvotes: Fixes button text for adding pages.
msom 01bc9d0
Core: Log execeptions instead of silenty ignoring them.
msom 138bc8c
Core: Use either secrets for random or indicate non-cryptographic usage.
msom 8fe84d0
Core: Indicate safe hardcoded password values.
msom 3b3a8da
Add bandit configuration [skip ci]
0428fa8
Exclude upgrade steps from bandit [skip ci]
aaba435
Core: Harden SQL code.
msom 290567d
Core: Enable bandit.
msom a0c8edb
Fix bandi config [skip ci]
ce400bf
Town6: Display previous and next entries
BreathingFlesh 8fdceca
Translator directory: Extend search filters.
cyrillkuettel e0b43a9
Translator directory: Display the forms in a two-column layout.
cyrillkuettel b1ede73
Translator directory: Open the mail client to send email to all trans…
cyrillkuettel b8ba06f
Translator directory: Display hometown and hide drive distance.
cyrillkuettel d64498e
Translator directory: Adds support for docx mail templates.
cyrillkuettel e990920
Release release-2023.20
cyrillkuettel 62e8b00
Election Day: Add conditional widgets for majority types.
msom 13e1833
Add freezgun hint to checklist [skip ci]
5707561
api: Every items of an API answer has now a 'modified' field
Tschuppi81 79701a2
Change the way the mailto link is rendered
cyrillkuettel f659933
Feriennet: Invoice item dates bug
BreathingFlesh 358c4fc
Winterthur: Include events in iframe resizing
BreathingFlesh 5de8311
Feriennet: Fix number of unlucky atteendees on dashboard
BreathingFlesh 0d602e5
Change namespace to path on server [skip ci]
BreathingFlesh bf7cef6
Translator directory: Several minor fixes.
cyrillkuettel 9bb940d
Translator directory: Minor adjustments.
cyrillkuettel 7619bfe
api: Adding geo location to agency api
Tschuppi81 826e29e
Translator direcory: Use distinct adresses in mailto link.
cyrillkuettel d9a6956
Translator directory: Make font slightly smaller in translator view.
cyrillkuettel 7c30aaa
Translator directory: Don't cache templates so they can be swapped out.
cyrillkuettel 0dc7fec
Landsgemeinde: Add landsgemeinde app.
msom 1029e9a
Release release-2023.21
a00a227
FSI: Add Organisation name to choice field
BreathingFlesh 36100f7
Feriennet: Add political municipality fields to wishlist bookings export
BreathingFlesh 7dec46b
Mypy: Adds static type checking to CI/pre-commit (#828)
Daverball dd80591
Org: Fix exception in hidden directory entries for logged out users
Daverball 55c5830
mypy: Adds stubs for onegov.core.orm
Daverball 292fd5b
Adding missing translations for org
Tschuppi81 a62f190
Revert "Adding missing translations for org"
Tschuppi81 b3a473b
org: Adding missing translations
Tschuppi81 e085245
api: Adding search capabilities to agency api (staka)
Tschuppi81 5a28c16
Landsgemeinde: Add vota.
msom 74004bf
Release release-2023.22
7bdac63
Core: Remove readline from shell, add commit.
710d5fa
mypy: Adds type annotations to onegov.core.crypto/onegov.core.security
Daverball 5ca96a7
Org: Set the .zip extension for directory export.
cyrillkuettel 38ca069
mypy: Adds type annotations for onegov.core.cache
Daverball 64838b3
Feriennet: Translation Fix
BreathingFlesh 6faa027
Pdf: Use Source Sans 3 instead of Helvetica.
msom 2ff994c
Adds a slightly faster CI workflow that will be used most of the time
Daverball 5a9b8dc
Adds a file for GitHub actions so we can test on a branch [skip-ci]
Daverball aac0032
Adds some minimal stuff to workflow for testing [skip-ci]
Daverball 6585a6d
Election Day: Adds compatibility with abraxas voting wabstic format.
53de35d
Switches from pytest-test-groups to pytest-split on CI
Daverball bbefb45
Election Day: Adds further compatibility with abraxas voting wabstic …
bb5f637
Adds a dummy file for a new GitHub actions workflow [skip-ci]
Daverball 96edba9
agency: Extract address from portrait field
Tschuppi81 9d82495
Move tests to GitHub Actions
Daverball 5420a1f
Add test badge to readme [skip ci]
msom ef9343b
Org: Improve presentation of context-specific function.
cyrillkuettel 85963fa
Disable ES, make user search working using postgresql
Tschuppi81 e43bff0
Initial move from es to psql search for town6
Tschuppi81 a4f1a36
Rework upgrade and re-indexing for users
Tschuppi81 43f8cf6
Adding fts index to events, move add/drop column function to utils
Tschuppi81 74c9d80
Adding fts index to Page (topics, news)
Tschuppi81 43dba69
Adding fts index to Person
Tschuppi81 46c261a
Adding fts index to Tickets
Tschuppi81 d61c7e2
Adding fts index to Directories
Tschuppi81 af63a5d
Generalize index creation in mixin, simplify search
Tschuppi81 e7acaed
Introduce separate view for psql search, extend reindex to index es a…
Tschuppi81 c1025b4
Adding fts index to File
Tschuppi81 f9fb612
Adding fts index to Filesets
Tschuppi81 f965c22
Adding fts index to Directory Entries and Newsletter
Tschuppi81 ebaaa82
Fix index creation for Person
Tschuppi81 dc6345b
Adding fts index to Agency and Forms
Tschuppi81 d7b0f3d
Adding fts index to Agency Memberships and External Links
Tschuppi81 73feb59
Adding fts index to Activities
Tschuppi81 7de7fc5
Adding fts index to Attendees
Tschuppi81 f5dd8a9
Adding fts index to fsi courses, attendees and events
Tschuppi81 1c928db
Adding fts index to landsgemeinde
Tschuppi81 b7811ea
Cleanup
Tschuppi81 ad1522b
Adding fts index to Translators
Tschuppi81 82ca4cb
Cleanup upgrade fts index
Tschuppi81 f77ec8f
Add multi lingual index to all tables (in one single index)
Tschuppi81 ad061b0
Adding separate postgres sugguest app
Tschuppi81 2bef9ac
Minor changes
Tschuppi81 b24f46c
Introduce search score for searchables
Tschuppi81 2a3e293
Measure psql and es indexing
Tschuppi81 8d4915a
Rework search and suggestion
Tschuppi81 925efdb
Finalize generic and hashtag search for postgres
Tschuppi81 4257aa7
Add ranking to generic search
Tschuppi81 b199afb
Search template to use model.load_batch_results
Tschuppi81 6a9745b
Rework search results for generic and hashtag search
Tschuppi81 6c1b161
Search template to use model.load_batch_results
Tschuppi81 60b1d40
Fix result count
Tschuppi81 3ddee8a
Fix typo
Tschuppi81 5b33138
Ensure postgres remains with it
Tschuppi81 7c4fe20
Adds postgres search view to agency
Tschuppi81 13060ff
Adds postgres search view to Fsi
Tschuppi81 d0e29c6
Minor changes
Tschuppi81 5269b04
Cleanup
Tschuppi81 f7dd958
Rename to SearchApp (technology independent)
Tschuppi81 7377b3b
Resovle todo's
Tschuppi81 3eb8ed6
Cleanup
Tschuppi81 160489e
Resolve Merge Conflics
Tschuppi81 4ea8bba
Revert renaming of var
Tschuppi81 6b1bdbf
Removing duplicates
Tschuppi81 418031a
Resolve merge conflicts
Tschuppi81 0db74a1
Revert changing CHANGES.md
Tschuppi81 4a028ec
Fix wrong resolving merge conflicts
Tschuppi81 ec1c929
Extend doc for get_fts_index_languages
Tschuppi81 df0034d
Extracs function for multi language tsvector
Tschuppi81 30e9264
Deactivatte psql search tests
Tschuppi81 7dddff7
Only define fts column, removing index definition for all searchable …
Tschuppi81 c2a3c83
Remove reportlab pinning
Tschuppi81 55fb336
Move fts index from Activity to VactionActivity
Tschuppi81 6f16ae1
Fix type check
Tschuppi81 b804e8a
Remove unused commit
Tschuppi81 31372e4
Resovle merge conflicts
Tschuppi81 6d42052
Prevent tables get indexed multiple times
Tschuppi81 90f7fec
Remove duplicated code
Tschuppi81 8697a70
Revert to master
Tschuppi81 d9ef346
Move tsvector generation almost entirely to mixins
Tschuppi81 5ab1328
Remove upgrade step for ts index column as reindexing uses the same f…
Tschuppi81 44de655
Add upgrade step for column renaming tickets.group
Tschuppi81 7a45daa
Reset back to master
Tschuppi81 be6e0e5
Revert to master
Tschuppi81 8263549
Revert "Add upgrade step for column renaming tickets.group"
Tschuppi81 66c3790
Revert column renaming
Tschuppi81 073d11d
Resolve merge conflicts
Tschuppi81 cbc3e12
Merge branch 'master' into feature/ogc-508-replace-elastic-search-by-…
Tschuppi81 d379db3
Revert to master
Tschuppi81 6d0129f
Move psql tsvector string generation to mixin
Tschuppi81 5709ff5
Fix tsvector generation for tickets as 'group' is a reserved word in …
Tschuppi81 25c3544
Revert "Fix tsvector generation for tickets as 'group' is a reserved …
Tschuppi81 f11a32d
Commit column name in tsvector string in case of keyword like group
Tschuppi81 2840efe
Improve search results score/sorting
Tschuppi81 c48734f
Prioritize events over pages
Tschuppi81 5134f22
Fix typo
Tschuppi81 79c9d90
Move full text search column to mixin
Tschuppi81 716c450
Resolve merge conflicts
Tschuppi81 f8854ba
Resolve merge conflicts
Tschuppi81 07ec6bb
Adjust tsvector string to support hybrid_properties
Tschuppi81 f14bf7d
Re-enable all properties
Tschuppi81 761ff34
Simplify tsvector string generation by making use of dict_property ac…
Tschuppi81 b9c9286
Adding additional test
Tschuppi81 f87d524
Resolve merge conflicts
Tschuppi81 dfb7ee9
Rework search mixin to use expressions
Tschuppi81 0589cf9
Extend upgrade context by has_index function
Tschuppi81 1773dd4
Improve collecting index properties
Tschuppi81 86cebc2
Rework index creation taking into account the property type
Tschuppi81 a312b45
Remove dependency to onegov.org
Tschuppi81 9aac0d0
Resolve merge conflicts
Tschuppi81 21e87ff
Switch hybrid to regular properties to make re-index work
Tschuppi81 c81a188
Via property the directory id with type uuid can now be indexed
Tschuppi81 59a478c
Add search score
Tschuppi81 400865e
Revert "Switch hybrid to regular properties to make re-index work"
Tschuppi81 308a7de
Revert "Via property the directory id with type uuid can now be indexed"
Tschuppi81 2bd99c3
Merge master
Tschuppi81 64a9655
Adds hybrid properties for search index properties
Tschuppi81 90bc8a9
Removing filter keywords as we also do not index the event tags
Tschuppi81 2b311e9
Merge branch 'master' into feature/ogc-508-replace-elastic-search-by-…
Tschuppi81 ccc6c0c
Adds hybrid properties for search index properties
Tschuppi81 eae5dcd
Adds directory id to fts index
Tschuppi81 e6fcdb1
DEV ONLY Issue to join data from other table in hybrid expression in …
Tschuppi81 ccbf117
Revert "DEV ONLY Issue to join data from other table in hybrid expres…
Tschuppi81 9e454e3
Fix hybrid properties and add expressions for Pages
Tschuppi81 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
from onegov.agency import AgencyApp | ||
from onegov.agency.layout import AgencySearchLayout | ||
from onegov.core.security import Public | ||
from onegov.org.models import Search | ||
from onegov.org.models import Search, SearchPostgres | ||
from onegov.org.views.search import search as search_view | ||
from onegov.org.views.search import search_postgres as search_postgres_view | ||
|
||
|
||
@AgencyApp.html(model=Search, template='search.pt', permission=Public) | ||
def search(self, request): | ||
def agency_search(self, request): | ||
data = search_view(self, request) | ||
if isinstance(data, dict): | ||
data['layout'] = AgencySearchLayout(self, request) | ||
return data | ||
|
||
|
||
@AgencyApp.html(model=SearchPostgres, template='search_postgres.pt', | ||
permission=Public) | ||
def agency_search_postgres(self, request): | ||
data = search_postgres_view(self, request) | ||
if isinstance(data, dict): | ||
data['layout'] = AgencySearchLayout(self, request) | ||
return data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tschuppi81 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from .file import File | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
from onegov.core.security import Personal | ||
from onegov.fsi import FsiApp | ||
from onegov.org.models import Search | ||
from onegov.org.models import Search, SearchPostgres | ||
from onegov.org.views.search import search as search_view | ||
from onegov.org.views.search import search_postgres as search_postgres_view | ||
from onegov.org.views.search import suggestions as suggestions_view | ||
from onegov.org.views.search import suggestions_postgres as \ | ||
suggestions_postgres_view | ||
|
||
|
||
@FsiApp.html(model=Search, template='search.pt', permission=Personal) | ||
def search(self, request): | ||
return search_view(self, request) | ||
|
||
|
||
@FsiApp.html(model=SearchPostgres, template='search_postgres.pt', | ||
permission=Personal) | ||
def search_postgres(self, request): | ||
return search_postgres_view(self, request) | ||
|
||
|
||
@FsiApp.json(model=Search, name='suggest', permission=Personal) | ||
def suggestions(self, request): | ||
return suggestions_view(self, request) | ||
|
||
|
||
@FsiApp.json(model=SearchPostgres, name='suggest', permission=Personal) | ||
def suggestions_postgres(self, request): | ||
return suggestions_postgres_view(self, request) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.