Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mango): add allow_fallback for user-specified indexes on _find #4792

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Oct 5, 2023

  1. mango: add allow_fallback for user-specified indexes on _find

    It is not always beneficial for the performance if the Mango query
    planner tries to assign an index to the selector.  User-specified
    indexes may save the day, but since they are only hints for the
    planner, fallbacks may still happen.
    
    Introduce the `allow_fallback` flag which can be used to tell if
    falling back to other indexes is acceptable when an index is
    explicitly specified by the user.  When set to `false`, give up
    on planning and return an HTTP 400 response right away.  This way
    the user has the chance to learn about the requested but missing
    index, optionally create it and try again.
    
    By default, fallbacks are allowed to maintain backwards
    compatibility.  It is possible to set `allow_fallback` to `true`
    but currently it coincides with the default behavior hence becomes
    a no-op in practice.
    
    Fixes apache#4511
    pgj committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    3cd732e View commit details
    Browse the repository at this point in the history
  2. mango: fix validation of use_index

    The `binary:split/2` function will split the input only at the
    first occurrence of the pattern which is not suitable for
    identifying each part of the index name, therefore validating it.
    Add the `global` option to fully break the index name into parts
    and let the related validation logic work as expected.
    pgj committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    449edf0 View commit details
    Browse the repository at this point in the history