Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Improve site search by allowing partial import path searches #153

Closed
Kapeli opened this issue Feb 25, 2014 · 3 comments
Closed

Improve site search by allowing partial import path searches #153

Kapeli opened this issue Feb 25, 2014 · 3 comments

Comments

@Kapeli
Copy link

Kapeli commented Feb 25, 2014

I noticed #66 and #93. Please consider fixing this by allowing partial import path searches and then just sort the results and show the most relevant ones at the top (i.e. the ones where the query matches the project name or user name).

This is somewhat related to #151.

@Kapeli
Copy link
Author

Kapeli commented Feb 25, 2014

I don't think either of the possible ways listed are suitable.

This is how search should work on godoc.org in my opinion:

  • Have an index/database which stores the following values:
    • complete import path (e.g. "github.com/FoundationDB/fdb-go/fdb")
    • import path without the domain (e.g. "FoundationDB/fdb-go/fdb")
    • the domain with a trailing slash (e.g. "github.com/")
  • Searching would then work like this:
    • Given a query %query%, first check if it matches the domain
    • If it matches the domain, check if query matches import path without the domain. If yes, add it to results
    • If it doesn't matches the domain, check if query matches complete import path. If yes, add it to results
    • Sample SQL query:
SELECT *
FROM table
WHERE (domain LIKE %query%
       AND partial_path LIKE %query%)
  OR (domain NOT LIKE %query%
      AND complete_path LIKE %query%)
  • Given the results, sorting would then do the rest and prioritise the results based on where they match and whatever else.

Of course, this would have to be optimised in terms of the database/index (e.g. the domains should be stored in a separate table and the query modified so that the domain is not checked for each entry).

Sample queries that would work:

  • Complete import path: code.google.com/p/go.net/html
  • Partial import path: code.google.com/p/go.n
  • Partial import path: go.net/html

Queries that would ignore the domain part of results, but give relevant results:

  • com
  • google.com
  • net
  • net/

@nathany
Copy link
Contributor

nathany commented May 29, 2014

The current version of Dash supports Go Docsets from godoc.org. @Kapeli can this ticket be closed? Or is it something we want godoc.org to support on the website too?

@Kapeli
Copy link
Author

Kapeli commented May 29, 2014

Yep. Thank you!

@Kapeli Kapeli closed this as completed May 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants