Skip to content

Ask search#8935

Open
mistergone wants to merge 9 commits intomainfrom
ask-search
Open

Ask search#8935
mistergone wants to merge 9 commits intomainfrom
ask-search

Conversation

@mistergone
Copy link
Copy Markdown
Member

@mistergone mistergone commented Oct 20, 2025

This PR changes Ask CFPB's search functions to using sitewide search. It also alters some styles, removes some old functions of Ask's Search, and adds Spanish translations where necessary.

Additions

  • Adds translations for new content

Removals

  • Removes previous Ask search frontend and switches to sitewide (Search.gov) search
  • Removes typeahead function

How to test this PR

Note: This PR can be difficult to fully test if you don't have access to Search.gov API key, so please reach out if I can help you test it.

  1. Pull it down
  2. Check out Ask's search functionality!

@mistergone mistergone self-assigned this Oct 20, 2025
@mistergone mistergone marked this pull request as ready for review October 22, 2025 15:26
Copy link
Copy Markdown
Contributor

@virginiacc virginiacc left a comment

Choose a reason for hiding this comment

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

@mistergone I added a few comments about possibilities for simplifying some of the Ask search templating now that it's being migrated to site search.

I'm also wondering if we could remove the answer-search-results.html template and the Ask autocomplete functionality? I don't think we need to load the autocomplete.js file anymore, and there's related django autocomplete code in several places in the Ask app.

</section>

{% for block in page.content %}
{% if block.block_type != 'notification' %}
Copy link
Copy Markdown
Contributor

@virginiacc virginiacc Nov 17, 2025

Choose a reason for hiding this comment

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

I don't remember -- is it possible to add a notification block to this page's content section in the admin?

{% endfor %}
</div>

<div class="m-notification
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we could add a new type (help?) to the notification molecule template so that could be used to output the notification content here:

{{- notification.render(
        'help',
        true,
        _('Can\'t find what you\'re looking for?'),
        '',
        [{
            'text': _('Search all of consumerfinance.gov'), 
            'url': _('/search/')  
        }]
    ) -}}

(And/or pull this notification out into a template so it can be reused on the see-all page?)

is_subsection=True,
max_length=75
) %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if this still needs to be a separate macro with various options if the search input is only being used on the answer page. Could we pull in the search bar from the searchgov page instead in the answer-page.html template, and just include the h3 header from here?

@anselmbradford
Copy link
Copy Markdown
Member

I'm currently working on a web component search input that supports an autocomplete (for the Ask use case). This might be handy to have in general, but sounds like autocomplete might completely go away?

@mistergone
Copy link
Copy Markdown
Member Author

I'm currently working on a web component search input that supports an autocomplete (for the Ask use case). This might be handy to have in general, but sounds like autocomplete might completely go away?

I wasn't involved in that decision, so it's probably a question for @ajbush or @schaferjh ?

@schaferjh
Copy link
Copy Markdown

@mistergone I think the typeahead you're removing here is the Ask-specific typeahead since this search box will now be site-wide search and should not return typeahead results for Ask questions only in the way it used to. I don't think we've made a decision about general auto-complete functionality.

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.

7 participants