Fix Graph Filter Error in Search#5665
Merged
dblock merged 9 commits intoopensearch-project:mainfrom Jan 9, 2023
mingshl:main
Merged
Fix Graph Filter Error in Search#5665dblock merged 9 commits intoopensearch-project:mainfrom mingshl:main
dblock merged 9 commits intoopensearch-project:mainfrom
mingshl:main
Conversation
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
reta
reviewed
Jan 6, 2023
| * check if the GraphTokenStreamFiniteStrings graph is empty | ||
| * return empty BooleanQuery result | ||
| */ | ||
| Iterator<TokenStream> graphIt = graph.getFiniteStrings(); |
reta
approved these changes
Jan 6, 2023
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
|
test failure in build 8978: Doesn't seem related to the code change. |
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
|
In build 8982: |
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
|
in build 8984: |
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Contributor
Gradle Check (Jenkins) Run Completed with:
|
opensearch-trigger-bot Bot
pushed a commit
that referenced
this pull request
Jan 9, 2023
* fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta
pushed a commit
that referenced
this pull request
Jan 9, 2023
* fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot Bot
pushed a commit
that referenced
this pull request
Jan 9, 2023
* fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dblock
pushed a commit
that referenced
this pull request
Jan 10, 2023
* fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Contributor
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-1.x 1.x
# Navigate to the new working tree
pushd ../.worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-5665-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6a7a9a1b2472f8d4a496d5b976ae16be87893b0e
# Push it to GitHub
git push --set-upstream origin backport/backport-5665-to-1.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-1.xThen, create a pull request where the |
mingshl
added a commit
to mingshl/OpenSearch-Mingshl
that referenced
this pull request
Jan 17, 2023
* fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1)
6 tasks
reta
pushed a commit
that referenced
this pull request
Jan 18, 2023
* Fix Graph Filter Error in Search (#5665) * fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1) * organize package pass compile test Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com>
kotwanikunal
pushed a commit
that referenced
this pull request
Jan 25, 2023
* fix graph filter out of bound error Signed-off-by: Mingshi Liu <mingshl@amazon.com> * add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com> * run gradle spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * reproduce error in unit test Signed-off-by: Mingshi Liu <mingshl@amazon.com> * format to pass spotlessApply Signed-off-by: Mingshi Liu <mingshl@amazon.com> * organize package Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit 6a7a9a1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.
Description:
curl -XPUT localhost:9200/test-index --data '{ "settings": { "index": { "analysis": { "analyzer": { "search_analyzer": { "filter": [ "stop", "asciifolding", "elision", "lowercase", "synonym_graph", "snowball", "unique" ], "tokenizer": "standard", "type": "custom" }, "index_analyzer": { "filter": [ "stop", "asciifolding", "elision", "word_delimiter", "flatten_graph", "lowercase", "snowball", "unique" ], "tokenizer": "standard", "type": "custom" } }, "filter": { "synonym_graph": { "lenient": "true", "synonyms": [ "head board, bed head, bedhead, headboard" ], "type": "synonym_graph" }, "synonyms": { "synonyms": [ "head board, bed head, bedhead, headboard" ], "type": "synonym" }, "word_delimiter": { "preserve_original": "true", "type": "word_delimiter" } } } } }, "mappings": { "dynamic": "strict", "properties": { "merchandising_keywords": { "analyzer": "index_analyzer", "index_options": "docs", "search_analyzer": "search_analyzer", "type": "text" } } } } ' -H "Content-Type:Application/json"curl 'localhost:9200/test-index/_search?pretty' --data '{"query": {"match": {"merchandising_keywords": "Gas Lift Storage Bed Frame with Arched Bed Head in King"}}}' -H "Content-Type:Application/json"'get 404 error' assertion error
[2022-12-29T15:07:35,251][INFO ][o.o.p.PluginsService ] [runTask-0] PluginService:onIndexModule index:[test-index/jVsetp_JTSuPkUBIeKFuYg][2022-12-29T15:07:35,290][DEBUG][o.o.c.c.C.CoordinatorPublication] [runTask-0] publication ended successfully: Publication{term=1, version=3} [2022-12-29T15:07:35,423][DEBUG][o.o.c.c.PublicationTransportHandler] [runTask-0] received diff cluster state version [4] with uuid [aSNgAs0GRIK8AkGNiu_TjQ], diff size [620] [2022-12-29T15:07:35,453][DEBUG][o.o.c.c.C.CoordinatorPublication] [runTask-0] publication ended successfully: Publication{term=1, version=4} [2022-12-29T15:07:49,047][INFO ][o.o.i.s.MatchQuery ] [runTask-0] check the sourceCachingTokenFilter@52e91aa3 term=,bytes=[],startOffset=55,endOffset=55,positionIncrement=0,positionLength=1,type=word,termFrequency=1,keyword=false [2022-12-29T15:07:49,048][INFO ][o.o.i.s.MatchQuery ] [runTask-0] check the GraphTokenStreamFiniteStringsorg.apache.lucene.util.graph.GraphTokenStreamFiniteStrings@6389dd20 [2022-12-29T15:07:49,048][INFO ][o.o.i.s.MatchQuery ] [runTask-0] articulationPoints.length: 0 [2022-12-29T15:07:49,048][INFO ][o.o.i.s.MatchQuery ] [runTask-0] i: 0 [2022-12-29T15:07:49,049][INFO ][o.o.i.s.MatchQuery ] [runTask-0] lastState: -1 [2022-12-29T15:07:49,049][INFO ][o.o.i.s.MatchQuery ] [runTask-0] end: -1 [2022-12-29T15:07:49,049][INFO ][o.o.i.s.MatchQuery ] [runTask-0] catch assertion error: java.lang.AssertionError: state=0 nextState=0to catch the error raising from lucene, and return empty query. Because there is no path found, no need to go further to analyze the graph, return empty query results.
** this is the query result as expected after the fix:
curl 'localhost:9200/test-index/_search?pretty' --data '{"query": {"match": {"merchandising_keywords": "Gas Lift Storage Bed Frame with Arched Bed Head in King"}}}' -H "Content-Type:Application/json"{
"took" : 68,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
Issues Resolved
#5379
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.