Skip to content

fix(server): fix match no index#3039

Open
LegendPei wants to merge 2 commits into
apache:masterfrom
LegendPei:fix/fix-match-no-index
Open

fix(server): fix match no index#3039
LegendPei wants to merge 2 commits into
apache:masterfrom
LegendPei:fix/fix-match-no-index

Conversation

@LegendPei
Copy link
Copy Markdown

@LegendPei LegendPei commented May 26, 2026

Purpose of the PR

This PR fixes a NoIndexException triggered by match() traversals when preceding has() filters contain index-required predicates such as neq() or range predicates but the related properties are not indexed.

In this case, HugeGraph extracted these filters into HugeGraphStep and pushed them into backend ConditionQuery, causing backend index validation to reject the traversal before TinkerPop could evaluate the filters normally.

Main Changes

  • Avoid extracting HasStep filters into HugeGraphStep when:

    • the following traversal step is match(), and
    • the has() predicate contains neq, gt, gte, lt, or lte.
  • Keep those filters in the traversal so they are evaluated by the normal TinkerPop filter path instead of being forced into backend index query planning.

  • Add a regression test covering the match() + no-index condition scenario from [Bug] NoIndexException triggered by match()-step #2936.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • mvn test -pl hugegraph-server/hugegraph-test -am -P core-test,rocksdb -Dtest=CountStrategyCoreTest#testMatchWithNoIndexConditionMatchesDirectTraversal -DfailIfNoTests=false
    • mvn test -pl hugegraph-server/hugegraph-test -am -P core-test,rocksdb -Dtest=CountStrategyCoreTest -DfailIfNoTests=false

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] NoIndexException triggered by match()-step

1 participant