From cf156f679d4f46c04e9afaf9107625f4e31d81b0 Mon Sep 17 00:00:00 2001 From: Kaltar5679 Date: Thu, 23 Apr 2015 10:34:40 +0200 Subject: [PATCH] Add attribute in index for mediaItem ans mediaCollection --- telemeta/search_indexes.py | 7 +++++++ .../indexes/telemeta/mediacollection_text.txt | 14 ++++++++++++++ .../search/indexes/telemeta/mediaitem_text.txt | 6 ++++++ 3 files changed, 27 insertions(+) diff --git a/telemeta/search_indexes.py b/telemeta/search_indexes.py index f73988bb..9738d552 100644 --- a/telemeta/search_indexes.py +++ b/telemeta/search_indexes.py @@ -11,3 +11,10 @@ class MediaItemIndex(indexes.SearchIndex, indexes.Indexable): return MediaItem +class MediaCollectionIndex(indexes.SearchIndex, indexes.Indexable): + + text = indexes.NgramField(document=True, use_template=True) + #rec_date = indexes.DateTimeField(use_template=True, null=True) + + def get_model(self): + return MediaCollection \ No newline at end of file diff --git a/telemeta/templates/search/indexes/telemeta/mediacollection_text.txt b/telemeta/templates/search/indexes/telemeta/mediacollection_text.txt index 4665cb55..9cea4c46 100644 --- a/telemeta/templates/search/indexes/telemeta/mediacollection_text.txt +++ b/telemeta/templates/search/indexes/telemeta/mediacollection_text.txt @@ -1,2 +1,16 @@ {{ object.title }} +{{ object.alt_title }} +{{ object.creator }} +{{ object.description }} +{{ object.collector }} +{{ object.publisher_serial }} +{{ object.booklet_author }} +{{ object.external_references }} +{{ object.cnrs_contributor }} +{{ object.booklet_description }} +{{ object.alt_copies }} +{{ object.comment }} +{{ object.archiver_notes }} +{{ object.items_done }} +{{ object.conservation_site }} {{ object.body }} diff --git a/telemeta/templates/search/indexes/telemeta/mediaitem_text.txt b/telemeta/templates/search/indexes/telemeta/mediaitem_text.txt index 5f044c0a..2077d4f2 100644 --- a/telemeta/templates/search/indexes/telemeta/mediaitem_text.txt +++ b/telemeta/templates/search/indexes/telemeta/mediaitem_text.txt @@ -1,6 +1,12 @@ {{ object.title }} +{{ object.alt_title }} {{ object.recorded_from_date }} {{ object.recorded_to_date }} {{ object.code }} +{{ object.old_code }} {{ object.location }} +{{ object.comment }} +{{ object.external_references }} +{{ object.location_comment }} +{{ object.cultural_area }} {{ object.body }} -- 2.39.5