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 #58

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

Search #58

wants to merge 4 commits into from

Conversation

losingkeys
Copy link
Collaborator

@losingkeys losingkeys commented May 5, 2017

Closes #45

Some notes:

  • I tried to keep the commits clean, but there's still some formatting stuff in there (in the markup). Sorry about that, I can remove it if you want
  • GH says it can't automatically merge... but I'm not sure why because after a fetch I can merge it into master just fine
    • It's been awhile since I've worked in a triangluar workflow :). Needed to rebase onto upstream/master instead of origin.
  • The FAQ search is case sensitive, but the Task search is not (limitation of the endpoints)
  • I haven't implemented Glossary search because I don't think the glossary is implemented yet
  • I still need to double check that this works on all the pages it should... but it at least works on the faq overview page and on individual task pages. Where else should it work at this point? I'm not completely sure because not everything's implemented yet
  • There's still some duplication in the search service. I can clean that up if you like... just gotta learn more typescript to do so :)

losingkeys added 3 commits May 4, 2017 21:46
- Copy paste issues (Haystack -> Metrics)
- Casing issues ([Kk]inetic)
- Deprecated dependency (angular2-infinite-scroll)
- Slightly wrong filename (timeline.component.*s*css)
Note: it's not clear to the user that you're only searching #tags here.
Also: this endpoint is case sensitive, while /ideaflow/tasks?tag=abc is
not.
How it works:
- Search on enter
- Show all results (or, if on the task page, the current task) when the
  search is cleared or only whitespace is entered
- Shows an error if there is one, example:
  Error while searching: Response with status: 500 Internal Error for URL: http://localhost:8080/storyweb/faq?tag=userQueryHere
  Please try again.
- Shows 'no results for ___' if nothing was found. Also shows the main
  list/all results/the current task in this case (as if the search had
  been cleared)

Caveats:
- Lots of code duplication
- There's no debouncing. If a user holds enter it /will/ hammer the
  backend server (though the backend should have rate-limiting
  eventually anyway, the ui also shouldn't be malicious in this way)
- Exposes inconsistent backend behavior. The search endpoints have some
  quirks:
  - /storyweb/glossary?tag[]=...
    - only searches term names
    - only searches term names prefixed with # (the user must not
      specify the '#'
    - (good) case insensitive
    - (good) will search partial words
  - /storyweb/faq/?tag[]=...
    - case sensitive
    - will only search a whole term (e.g. 'tes' doesn't match 'test')
    - (seems fine) only searches for #hashtags, I think only in
      descriptions but I haven't verified that
  - /ideaflow/task?tag[]=...
    - (good) case insensitive
    - (good) will search partial words
    - (seems ok... but confusing) only searches #hashtags, but the user
      won't see those unless they click into the task... so you have to
      know what you're looking for (i.e. it cannot be used as a filter)
@losingkeys
Copy link
Collaborator Author

This is finally ready for review! See the commit message in d16b0e6 for commentary about how it works and some things that need to be opened as issues for the backend service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants