vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.58k stars 586 forks source link

Add validation for struct-field indexing statement: index is not supported #21630

Closed jobergum closed 2 years ago

jobergum commented 2 years ago

Example from documentation

struct person {
    field first_name type string {}
    field last_name type string {}
}
field identities type map<string, person> {
    indexing: summary
    struct-field key { indexing: attribute }
    struct-field value.last_name { indexing: attribute }
}

This is fine, but I have seen reports of vespa accepting indexing: index which is not supported

field identities type map<string, person> {
    indexing: summary
    struct-field key { indexing: attribute|index}
    struct-field value.last_name { indexing: index }
}
geirst commented 2 years ago

Specifying index is used by streaming search to signal whether the field is searchable. Validation must be added at a higher level where the document mode (streaming vs indexed) is known.

geirst commented 2 years ago

This is fixed in 8.18.6 (https://github.com/vespa-engine/vespa/pull/23485).