Semantic MediaWiki and related extensions
Objective

The SEARCH_FORM_SCHEMA schema type defines forms used in the extended Special:Search profile.

Properties

Example

{
    "type": "SEARCH_FORM_SCHEMA",
    "forms": {
        "Foo": [],
    }
    "tags": [
        "search form"
    ]
}

Form definition

{
    "type": "SEARCH_FORM_SCHEMA",
    "forms": {
        "Books and journals": [
            "Has title",
            "Has author",
            "Has year",
            {
                "Publication type": {
                    "autocomplete": true,
                    "tooltip": "Some context to be shown ...",
                    "required": true
                }
            },
            {
                "Publisher": {
                    "autocomplete": true
                    "tooltip": "message-can-be-a-msg-key"
                }
            }
        ],
        "Media and files": [ ]
    }
}

Fields can define attributes such as:

Default form

default_form to define a default form that is displayed when no other form was preselected.

{
    "type": "SEARCH_FORM_SCHEMA",
    "default_form": "Books and journals",
    ...
}

Term parser

The term_parser prefix can be used to shorten the input cycle and summarize frequent properties so that a user can write:

{
    "type": "SEARCH_FORM_SCHEMA",
    "term_parser": {
        "prefix": {
            "lang": [
                "Language code",
                "Document language",
                "File attachment.Content language",
                "Has interlanguage link.Page content language"
            ]
        }
    }
}

Prefixes are only applicable (and usable as means to shorten the search term) from within the extended search form.

Namespaces

namespaces section defines namespaces to be preslected or hidden.

{
    "type": "SEARCH_FORM_SCHEMA",
    "namespaces": {
        "default_hide": true,
        "hidden": [
           "NS_PROJECT",
           "NS_PROJECT_TALK"
        ],
        "preselect": {
           "Books and journals": [
                "NS_CUSTOM_BOOKS",
                "NS_FILE"
            ],
           "Media and files": [
                "NS_FILE"
            ]
        }
    }
}

Descriptions

Describes a form and is shown at the top of the form fields to inform users about the intent of the form.

{
    "type": "SEARCH_FORM_SCHEMA",
    "descriptions": {
        "Books and journals": "Short description to be shown on top of a selected form"
    }
}

Validation

/data/schema/search-form-schema.v1.json


About | General disclaimer | Privacy policy