MB-65170: Add filter support to BooleanQuery#2147
Closed
CascadingRadium wants to merge 24 commits intomasterfrom
Closed
MB-65170: Add filter support to BooleanQuery#2147CascadingRadium wants to merge 24 commits intomasterfrom
CascadingRadium wants to merge 24 commits intomasterfrom
Conversation
231baf2 to
2b640f6
Compare
Member
|
@CascadingRadium would you resolve conflicts that've popped up here - it seems we can get this in after. |
__NOTES:__ - In the cases where I can use a `unit test` to test the code, I will do it. The unit test I added was created by `Github Copilot Agent` using the model `Gemini 2.5 Pro`, and most of them were adapted by me. - Some of the improvements I made are not directly related to the `golangci-lint` findings, but I believe they are important for the project. All of them were proposed by `Github Copilot Agent` using the model `Gemini 2.5 Pro`, but I modified most of them so that they wouldn't alter the code too much and facilitate the `code review`. This delivery improves two golangci-lint findings: 1. `S1023:` redundant break statement (staticcheck) 2. `QF1003:` could use tagged switch on count (staticcheck) ```bash golangci-lint --version golangci-lint has version v2.1.2 built with go1.24.2 from (unknown, modified: ?, mod sum: "h1:bcOB+jVr4EYEgOEIskQIhtdxOpIGl+iOCwliG/hNPXw=") on (unknown) ``` Fixed the following files and lines: - minor formatting changes - `golangci-lint run --enable-only staticcheck ./... | grep "S1023"` - analysis/char/asciifolding/asciifolding.go:3564:5: S1023: redundant break statement (staticcheck) - `golangci-lint run --enable-only staticcheck ./... | grep "QF1003"` - analysis/datetime/iso/iso.go:176:6: QF1003: could use tagged switch on count (staticcheck) - analysis/datetime/percent/percent.go:87:3: QF1003: could use tagged switch on formatString[idx+2] (staticcheck) - analysis/lang/cjk/cjk_bigram.go:165:2: QF1003: could use tagged switch on *itemsInRing (staticcheck) - index/scorch/merge_test.go:45:3: QF1003: could use tagged switch on e.Kind (staticcheck) - index/scorch/snapshot_index.go:334:2: QF1003: could use tagged switch on fuzziness (staticcheck) - mapping/document.go:486:5: QF1003: could use tagged switch on fieldMapping.Type (staticcheck) - mapping/document.go:571:6: QF1003: could use tagged switch on fieldMapping.Type (staticcheck) - mapping/field.go:234:2: QF1003: could use tagged switch on fm.Type (staticcheck) - mapping/field.go:337:2: QF1003: could use tagged switch on shape (staticcheck) - search/sort.go:157:2: QF1003: could use tagged switch on input (staticcheck) - search/sort.go:429:2: QF1003: could use tagged switch on stype (staticcheck)
…ex` option is `False` (#2190) - If a field mapping for a vector or geoshape has the `Index` option set to `false`, the field is still indexed because the current code incorrectly always overrides this option to `true`. - This behavior has been fixed by ensuring that the Index option is not overridden and the field is only indexed if explicitly allowed by the user-specified Index setting.
- Previously, filter queries were not validated during the KNN request validation phase, which could lead to unexpected filter query behavior. This has been fixed by adding proper validation. - Also fixed an issue where errors during JSON unmarshalling of invalid filter queries were being silently ignored.
…ment plugins (#2192) - Fixed a bug where legacy segment plugins caused an infinite loop during query execution; the synonym set is now correctly left empty, triggering fallback to basic FTS search without synonyms - Refactored related code for improved clarity and performance
- LineStrings containing Points and MultiPoints is now supported. Changed testcases related to it - Added more detailed documentation for geoshape support
Linked Geo PR - blevesearch/geo#27 --------- Co-authored-by: Abhinav Dangeti <abhinav@couchbase.com>
- Used a tool to identify and fix lint errors in all the markdown files. - Fixed code examples to use only the exported bleve package (and not internal ones) - Formatted JSON and code examples throughout - Added Hybrid Search example to vectors.md --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rchers (#2146) - When using the `Advance()` API on an `IndexSnapshotTermFieldReader`, a special replacement mechanism is applied during a `Rewind`— when the requested document ID is behind the current document ID pointed to by the reader. In such cases, the object itself gets replaced. - However, this approach fails when the `IndexSnapshotTermFieldReader` is created by the `optimizeCompositeSearcher` method, which is used to construct optimized `conjunction` or `disjunction` searchers. - The issue arises because the `unadornedTermFieldReader` is initialized with the `term` set to `<optimization-type>` and `field` set to `*`. As a result, calling `Advance()` renders the entire `TFR` unusable, as it gets replaced by a dummy `TFR` that no longer functions. - This problem occurs specifically when calling `Advance()` on the `unadornedTermFieldReader` with an ID less than the current posting ID (triggering the rewind mechanism). - The issue is resolved by resetting the underlying `unadornedPostingsIteratorBitmap`, which effectively achieves the same result as the `TFR` replacement technique without rendering it unusable.
- Added a new field to document match to store the decoded sort values - Added implementations for decoding numeric, datetime and geo sort values - Added appropriate test cases for the same Also, upgrade zapx/v16 for fix: * 4e38ae4 Likith B | MB-59633: Support list of geo shapes for a single field --------- Co-authored-by: Abhinav Dangeti <abhinav@couchbase.com>
- As an edge case, the segment layout can be such that the merge planning generates tasks having only a single non-empty segment. - When this task is processed and introduced into the scorch system, the root doesn't change and you'd be stuck in an infinite loop because the same segment is still present in the system and the plan keeps generating the task with the same single segment, which doesn't converge the index to a steady state.
…ver non textual content (#2208) Add search after functionality for numeric, datetime, and geo fields in TopNCollector - Introduced new test cases for searching after numeric, datetime, and geo fields. - Implemented encoding for pagination on these fields to enhance search capabilities. - Updated the createSearchAfterDocument function to support encoded sort values. - Ensured proper handling of search results in the new test cases. This enhances the search functionality by allowing users to paginate through results based on specific criteria.
In the Go 1.21 standard library, a new function has been introduced that enhances code conciseness and readability. It can be find [here](https://pkg.go.dev/slices@go1.21.1#Equal). Signed-off-by: houpo-bob <houpocun@outlook.com>
- Fixed a testcase that initialized an invalid geometry collection object - Pulling in geo v0.2.4
Added short documentation about pagination in Bleve
Member
Author
|
opened #2220 after rebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filterquery for Boolean queries, which filters the document set returned by theBoolean query itself.
must also satisfy the filter query.
Filterquery and placing an equivalent query in theMustclause is that queries in theMustclause contribute to the score. TheFilterquery is intended purely for filtering purposes without modifying the document scores
set by the base Boolean query.
to allow for the usage of the
AdvancedAPI in case theFilterQueryis an optimizedcomposite searcher.