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

Miroslavsimek/be 187 make search diacritics insensitive #67

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions models/nr-documents/model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ record:
extra-code: |-2
# extra custom fields for sorting by title
sort = {{nr_docs_extensions.services.sort.TitleICUSortField}}(source_field="metadata.title")

title_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field="metadata.title")
creator_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field="metadata.creators.fullName")
contributor_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field="metadata.contributors.fullName")
abstract_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field="metadata.abstract.value")
draft: {}
draft-files: {}
use:
Expand Down
2 changes: 1 addition & 1 deletion models/nr-documents/nr_documents/models/records.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"imports": []
},
"record": {
"extra-code": " # extra custom fields for sorting by title\n sort = {{nr_docs_extensions.services.sort.TitleICUSortField}}(source_field=\"metadata.title\")",
"extra-code": " # extra custom fields for sorting by title\n sort = {{nr_docs_extensions.services.sort.TitleICUSortField}}(source_field=\"metadata.title\")\n\n title_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.title\")\n creator_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.creators.fullName\")\n contributor_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.contributors.fullName\")\n abstract_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.abstract.value\")",
"base-classes": [
"invenio_drafts_resources.records.api.Record{InvenioRecord}"
],
Expand Down
6 changes: 6 additions & 0 deletions models/nr-documents/nr_documents/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from nr_docs_extensions.services.sort import TitleICUSortField
from oarepo_runtime.records.relations import PIDRelation, RelationsField
from oarepo_runtime.records.systemfields.has_draftcheck import HasDraftCheckField
from oarepo_runtime.records.systemfields.icu import ICUSearchField
from oarepo_runtime.records.systemfields.record_status import RecordStatusSystemField

from nr_documents.files.api import NrDocumentsFile, NrDocumentsFileDraft
Expand Down Expand Up @@ -57,6 +58,11 @@ class NrDocumentsRecord(InvenioRecord):
# extra custom fields for sorting by title
sort = TitleICUSortField(source_field="metadata.title")

title_search = ICUSearchField(source_field="metadata.title")
creator_search = ICUSearchField(source_field="metadata.creators.fullName")
contributor_search = ICUSearchField(source_field="metadata.contributors.fullName")
abstract_search = ICUSearchField(source_field="metadata.abstract.value")

relations = RelationsField(
accessRights=PIDRelation(
"metadata.accessRights",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"POT-Creation-Date: 2023-12-04T10:22:06.819037\n"
"PO-Revision-Date: 2023-12-04T10:22:06.819047\n"
"POT-Creation-Date: 2023-12-05T13:52:29.456931\n"
"PO-Revision-Date: 2023-12-05T13:52:29.456942\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"POT-Creation-Date: 2023-12-04T10:22:06.819069\n"
"PO-Revision-Date: 2023-12-04T10:22:06.819070\n"
"POT-Creation-Date: 2023-12-05T13:52:29.456966\n"
"PO-Revision-Date: 2023-12-05T13:52:29.456967\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
4 changes: 2 additions & 2 deletions models/nr-documents/nr_documents/translations/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"POT-Creation-Date: 2023-12-04T10:22:06.819085\n"
"PO-Revision-Date: 2023-12-04T10:22:06.819086\n"
"POT-Creation-Date: 2023-12-05T13:52:29.456984\n"
"PO-Revision-Date: 2023-12-05T13:52:29.456985\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
Loading