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

Fix any value and no value complements in advanced search #11732

Open
wants to merge 2 commits into
base: dev/7.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions arches/app/search/components/advanced_search.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from arches.app.datatypes.datatypes import DataTypeFactory
from arches.app.models.models import (
Node,
DDataType,
GraphModel,
CardModel,
CardXNodeXWidget,
DDataType,
GraphModel,
Node,
)
from arches.app.models.system_settings import settings
from arches.app.datatypes.datatypes import DataTypeFactory
from arches.app.utils.betterJSONSerializer import JSONDeserializer
from arches.app.search.elasticsearch_dsl_builder import Bool, Nested
from arches.app.search.components.base import BaseSearchFilter
from arches.app.search.elasticsearch_dsl_builder import Bool
from arches.app.utils.betterJSONSerializer import JSONDeserializer

details = {
"searchcomponentid": "",
Expand Down Expand Up @@ -61,11 +61,9 @@ def append_dsl(self, search_query_object, **kwargs):
datatype.append_search_filters(
val, node, tile_query, self.request
)
nested_query = Nested(path="tiles", query=tile_query)
if advanced_filter["op"] == "or" and index != 0:
grouped_query = Bool()
grouped_queries.append(grouped_query)
grouped_query.must(nested_query)
grouped_query.must(null_query)
for grouped_query in grouped_queries:
advanced_query.should(grouped_query)
Expand Down
1 change: 1 addition & 0 deletions releases/7.6.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix Activity Stream id value [#11727](https://github.com/archesproject/arches/issues/11727)
- Prevent Arches templates from overriding App templates [#11731]https://github.com/archesproject/arches/pull/11731
- Fix the complement of "Has Any Value" and "Has No Value" in advanced search [#11424](https://github.com/archesproject/arches/issues/11424)


### Dependency changes:
Expand Down
Loading