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

Add search autocomplete suggestions #504

Open
robhudson opened this Issue Oct 29, 2013 · 8 comments

Comments

@robhudson
Copy link
Contributor

robhudson commented Oct 29, 2013

Relevant Elasticsearch docs:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html

For project search we can autocomplete project name or slug.

For page search within a project we can autocomplete page titles and possibly headers? This may or may not be as useful as project autocompletion.

@ericholscher

This comment has been minimized.

Copy link
Member

ericholscher commented Sep 5, 2014

On the section index:

            'suggest': {
                'foo, bar'
                'payload': {
                    url
                    pk
                }

            }
@ronakkhunt

This comment has been minimized.

Copy link
Contributor

ronakkhunt commented Jul 29, 2016

I would like to give it a try.

@ericholscher

This comment has been minimized.

Copy link
Member

ericholscher commented Jul 29, 2016

Great -- we're using elastic search as the backend, which can be setup locally as documented here: http://docs.readthedocs.io/en/latest/rtfd.html#elastic-search-setup

The main search views are here: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/search/views.py

I'm not 100% sure how to implement this on the ES side, so that would take some research.

@safwanrahman safwanrahman added this to Backlog in Search update via automation May 21, 2018

@ericholscher ericholscher moved this from Backlog to Up next in Search update Jun 15, 2018

@safwanrahman

This comment has been minimized.

Copy link
Member

safwanrahman commented Jun 15, 2018

Really excited to see its coming next to my work.
@ericholscher Is it possible to provide any UI or something like that so I can try to implement them? Can anyone from the team help me do the frontend things? Can you design the API for the suggestions?

@safwanrahman

This comment has been minimized.

Copy link
Member

safwanrahman commented Jun 15, 2018

@robhudson Thanks a lot for filling the issue. I will work on this in next couple of weeks.
Do you have any suggestion you would like to provide that will help me to implement this?

@ericholscher

This comment has been minimized.

Copy link
Member

ericholscher commented Jun 18, 2018

I'd really like to see us be able to index & autocomplete API objects as well. So that you could type Pro and it would autocomplete Project or similar. I don't know the best UI for it though.

This existing Sphinx extension has at least a basic take on this: https://github.com/jimfulton/sphinxautoindex/tree/master/findanything -- but could definitely use some UX improvements :)

@safwanrahman safwanrahman self-assigned this Jun 19, 2018

@safwanrahman safwanrahman added this to the Search improvements milestone Jun 22, 2018

@safwanrahman

This comment has been minimized.

Copy link
Member

safwanrahman commented Jun 25, 2018

I have investigated about it and found that we need some UX decision about it.
From my thinking, we can implement one of the following

  • Google style autocomplete suggestion for Document Search/Page Search. Also provide misspelled suggestion something like "Did you mean". It can be implemented by using Completion Suggester. As it keeps everything in RAM, for reducing the usage, we can only keep headers and titles for autocomplete query.

  • Search as You type functionality can also be implemented in the Document Search. So while a person types anything into the search box, it will make the query and show the relavant result!

Example

screen shot 2018-06-25 at 9 21 37 pm

We have search page where we can implement easily Search as you Type functionality easily. But we need to decide if we want that feature also in the sidebar.

Moreover, we need to learn about ngram thing of elasticsearch in order to implement a good suggestion and search functionality.

@humitos

This comment has been minimized.

Copy link
Member

humitos commented Jun 25, 2018

As it keeps everything in RAM, for reducing the usage, we can only keep headers and titles for autocomplete query.

This sounds to not scale in a good way and probably something that we can't support in the community site with thousands of projects.

Search as You type functionality can also be implemented in the Document Search

The example you showed here it's amazing to me and I'd like to follow that direction!

These are just opinions, though, I'm not really involved in the search world inside Read the Docs.

@safwanrahman safwanrahman moved this from Up next to In progress in Search update Jun 27, 2018

@ericholscher ericholscher moved this from In progress to Backlog in Search update Jul 6, 2018

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