Skip to content

IllegalArgumentException / UNEXPECTED_SERVER_ERROR in FindAndRerank when omitting $vectorize in $hybrid #2577

Description

@sl-at-ibm

A collection with lexical, rerank and vectorize support still may return a "naked" Unexpected server error / IllegalArgumentException when a findAndRerank command does not provide a $vectorize (rather only $lexical) in its sort clause and rerankQuery is provided.

Expectation: an error message that does not expose an internal exception, rather wraps it and rejects it gracefully at command-validation stage. (see current error below)

Verified on 2026-09-03 on a prod Astra Data API on kube 189267260851 (AWS us-east-2)

Reproduction

Note: below, "bad query" means not that this does not succeed (which is the correct thing): it means that the returned error looks like a unhandled internal "IllegalArgumentException" rather than a clean validation error. When omitting $vectorize from the sort, but also skipping rerankQuery, the error is a good, clear validation error as it should be (==> MISSING_RERANK_QUERY_TEXT).

Create collection:

{
    "createCollection": {
        "name": "c",
        "options": {
            "vector": {
                "service": {
                    "provider": "nvidia",
                    "modelName": "nvidia/nv-embedqa-e5-v5"
                }
            }
        }
    }
}

Bad query 1:

{
    "findAndRerank": {
        "filter": {
            "$lexical": {
                "$match": "bla"
            }
        },
        "sort": {
            "$hybrid": {
                "$lexical": "ble"
            }
        },
        "options": {
            "rerankOn": "$lexical",
            "rerankQuery": "blo"
        }
    }
}

Bad query 2:

{
    "findAndRerank": {
        "filter": {
            "$lexical": {
                "$match": "bla"
            }
        },
        "sort": {
            "$hybrid": {
                "$lexical": "ble"
            }
        },
        "options": {
            "rerankQuery": "blo"
        }
    }
}

Naked error the caller receives:

Unexpected server error: An unexpected server error occurred while processing the request. 

Error Class: IllegalArgumentException
Error Message: buildVectorRead() - no vector or vectorize

Review the Error Message before retrying this request. (UNEXPECTED_SERVER_ERROR)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions