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

Search: show only results from the current role_name being filtered #8454

Merged
merged 1 commit into from Sep 1, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Aug 31, 2021

TLDR; show only domains that match the selected role_name.

before

there are http:get roles mixed with http:post (mixed with results from top docs)

Screenshot 2021-08-31 at 18-42-38 Search project Read the Docs

now

there are only domains with http:post in the results (mixed with results from top docs)

Screenshot 2021-08-31 at 18-11-32 Search project Read the Docs

Long version, see the comment in the code and #8268 (comment).

Closes #8268

blocks = first_result['blocks']
for block in blocks:
assert block['type'] == 'domain'
assert block['role'] == confval_facet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test fails without this change, previously we were checking if the first block was py:class, but the second block was py:function...

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks simple enough.

Comment on lines +373 to +374
# TODO: We should use a flattened document instead
# to avoid this kind of problems and have faster queries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I feel like we've mentioned this a number of times. Really should figure it out at some point. Is this tracked in an issue or roadmap card anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a new issue and add it for a future task in our roadmap 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #8457, I put a card on the "Needs discussion" column.

@stsewd stsewd merged commit 70ddf61 into master Sep 1, 2021
@stsewd stsewd deleted the fix-search-role-name branch September 1, 2021 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search by role name is broken
2 participants