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

First pass at HTML search results #97

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

First pass at HTML search results #97

wants to merge 6 commits into from

Conversation

beckyjackson
Copy link
Collaborator

Resolves #96

See demo on the ONTIE DROID: https://droid.ontodev.com/ONTIE/branches/html-search-demo/views/src/scripts/tree.sh?id=DOID%3A0060499&db=ontie

If you type in the search box, typeahead will still display predictive text. If you click one of the search results from typeahead or press the down arrow and hit enter while one of those search results is highlighted, it will take you directly to that term. Alternatively, if you type in some text and hit enter without highlighting a search result, it will take you to a search result page: https://droid.ontodev.com/ONTIE/branches/html-search-demo/views/src/scripts/tree.sh?search_text=immune&db=ontie

From there, you can click on a term to go to that term's page. This is the same way that the OLS search bar works, as far as I can tell.

This is a first pass at the HTML display for search results, I'm happy to update this page as needed. Here's some info from the docs on using it in the command line. There are quite a few new args, but you can ignore them if you're using the JSON output.

gizmos.search - HTML

You can also return the search results as an HTML page. The module includes a few additional options to do this, but minimally, you need to include -f/--format:

python3 -m gizmos.search [path-to-database] [search-text] -f html > [output-html]

The additional options for use with the HTML output are:

  • -H/--href: the query string format to use in links to search results, see Tree Links
  • d/--db-name: the name of the database if you want to include it in your href
  • -r/--include-search: flag to include a search bar at the top of the search results page
  • -c/--contents-only: flag to only produce HTML content without the <html> and <body> tags

... and here's how I've implemented it for ONTIE in a tree.sh script: https://github.com/IEDB/ONTIE/blob/html-search-demo/src/scripts/tree.sh

The relevant code is that the search bar now directs to ?search_text=[SEARCH_TEXT]&db=[DB] (if a db name has been provided) when you hit enter without highlighting a typeahead result.

Copy link
Member

@jamesaoverton jamesaoverton left a comment

Choose a reason for hiding this comment

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

I don't think this is using Bootstrap table styling? Could you please do that.

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.

Implement search results list or table
2 participants