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

Indexing language produces unexpected results with if used in for_each #29690

Open
dainiusjocas opened this issue Dec 18, 2023 · 2 comments
Open
Assignees
Labels
Milestone

Comments

@dainiusjocas
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Schema is as follows:

schema doc {
 field modified_chunks type array<string> {
        indexing {
            input chunks | for_each {
                if (1 == 1) {
                    "YES " . _;
                } else {
                    "NO " . _;
                }
            } | summary;
        }
    }

   document doc {
        field chunks type array<string> {
            indexing: summary | index
        }
    }
}

**Expected behavior**
Indexed text in the field `modified_chunks` is `YES some text`. Because `if` produces an output and that output should be used by the `for_each`.

**Environment (please complete the following information):**
 - macos
 - Infrastructure: docker
 - Versions newest

**Vespa version**
8.256.22

**Additional context**
The actual task was to avoid embedding chunks that are very short. If the above indexing script would work as expected, then that would be doable.
@kkraune kkraune added the bug label Dec 20, 2023
@geirst geirst added this to the soon milestone Jan 3, 2024
@dainiusjocas
Copy link
Contributor Author

Some more workarounds that are needed in for_each can be found in this repo.

@dainiusjocas
Copy link
Contributor Author

Related issue #30512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants