Example #1
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document,
                                   SearchRoute.FIELDS)

        SearchDocument.copy_enum_range_fields(search_document, document,
                                              SearchRoute.ENUM_RANGE_FIELDS,
                                              SearchRoute)

        for locale in document.locales:
            search_document['title_' + locale.lang] = \
                get_title(locale.title, locale.title_prefix)

        if document.associated_waypoints_ids:
            # add the document ids of associated waypoints and of the parent
            # and grand-parents of these waypoints
            search_document['waypoints'] = \
                document.associated_waypoints_ids.waypoint_ids

        if document.associated_users_ids:
            # add the document ids of associated users
            search_document['users'] = \
                document.associated_users_ids.user_ids

        return search_document
Example #2
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document,
                                   SearchOuting.FIELDS)

        SearchDocument.copy_enum_range_fields(search_document, document,
                                              SearchOuting.ENUM_RANGE_FIELDS,
                                              SearchOuting)

        if document.associated_waypoints_ids:
            # add the document ids of associated waypoints and of the parent
            # and grand-parents of these waypoints
            search_document['waypoints'] = \
                document.associated_waypoints_ids.waypoint_ids

        if document.associated_users_ids:
            # add the document ids of associated users
            search_document['users'] = \
                document.associated_users_ids.user_ids

        if document.associated_routes_ids:
            # add the document ids of associated routes
            search_document['routes'] = \
                document.associated_routes_ids.route_ids

        return search_document
Example #3
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(
            search_document, document, SearchOuting.FIELDS)

        SearchDocument.copy_enum_range_fields(
            search_document, document, SearchOuting.ENUM_RANGE_FIELDS,
            SearchOuting)

        if document.associated_waypoints_ids:
            # add the document ids of associated waypoints and of the parent
            # and grand-parents of these waypoints
            search_document['waypoints'] = \
                document.associated_waypoints_ids.waypoint_ids

        if document.associated_users_ids:
            # add the document ids of associated users
            search_document['users'] = \
                document.associated_users_ids.user_ids

        if document.associated_routes_ids:
            # add the document ids of associated routes
            search_document['routes'] = \
                document.associated_routes_ids.route_ids

        return search_document
Example #4
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document, SearchBook.FIELDS)

        return search_document
Example #5
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(
            search_document, document, SearchBook.FIELDS)

        return search_document
Example #6
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(
            document, index, include_areas=False)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document,
                                   SearchArea.FIELDS)

        return search_document
Example #7
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(
            document, index, include_areas=False)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(
            search_document, document, SearchArea.FIELDS)

        return search_document
Example #8
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(
            search_document, document, SearchWaypoint.FIELDS)
        search_document['has_phone'] = not(not(
            document.phone or document.phone_custodian))

        return search_document
Example #9
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        search_document['article_categories'] = document.categories

        SearchDocument.copy_fields(
            search_document, document, SearchArticle.FIELDS)

        return search_document
Example #10
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document,
                                   SearchWaypoint.FIELDS)
        search_document['has_phone'] = not (not (document.phone
                                                 or document.phone_custodian))

        return search_document
Example #11
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(
            search_document, document, SearchXreport.FIELDS)

        SearchDocument.copy_enum_range_fields(
            search_document, document, SearchXreport.ENUM_RANGE_FIELDS,
            SearchXreport)

        return search_document
Example #12
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(
            search_document, document, SearchXreport.FIELDS)

        SearchDocument.copy_enum_range_fields(
            search_document, document, SearchXreport.ENUM_RANGE_FIELDS,
            SearchXreport)

        return search_document
Example #13
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document,
                                   SearchRoute.FIELDS)

        for locale in document.locales:
            search_document['title_' + locale.lang] = \
                get_title(locale.title, locale.title_prefix)

        return search_document
Example #14
0
    def to_search_document(document, index):
        search_document = SearchDocument.to_search_document(document, index)

        if document.redirects_to:
            return search_document

        SearchDocument.copy_fields(search_document, document, SearchRoute.FIELDS)

        SearchDocument.copy_enum_range_fields(search_document, document, SearchRoute.ENUM_RANGE_FIELDS, SearchRoute)

        for locale in document.locales:
            search_document["title_" + locale.lang] = get_title(locale.title, locale.title_prefix)

        if document.associated_waypoints_ids:
            # add the document ids of associated waypoints and of the parent
            # and grand-parents of these waypoints
            search_document["waypoints"] = document.associated_waypoints_ids.waypoint_ids

        return search_document