8000 ordering of search results is affected by Max Results · Issue #89 · google/zoekt · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

ordering of search results is affected by Max Results #89

Open

Description

@ijt

Increasing the max results can affect the ordering of the search results. Here is an example.

Screen Shot 2019-07-03 at 12 02 19

Having stable ordering of search results would be a useful property and less surprising for users.

Activity

  1. ijt commented on Jul 3, 2019

    @ijt
    ContributorAuthor

    I would be willing to work on this.

  2. hanwen commented on Jul 3, 2019

    @hanwen
    Contributor

    How would you do it?

    Basically, you the search engine shows the best result on top. If you search over a larger corpus, you can find better matches, which displaces other results and changes ordering.

  3. ijt commented on Jul 4, 2019

    @ijt
    ContributorAuthor

    One possibility would be to present the results in the order they occur within the posting lists. Items in posting lists could have an additional weight field corresponding to their estimated general relevance. The posting lists could be sorted according to the weights, and re-sorted as necessary.

    That would degrade the ordering though. The question needs some more thought.

  4. hanwen commented on Jul 4, 2019

    @hanwen
    Contributor

    @ijt - If you mean "index shard" when you say "posting list", this is exactly how it works already.

    Within a shard, files are ordered by importance (important files first), so eg. all things equal you get matches from non-test files before test files.

    Then the shards themselves are ordered by "quality" score, which is mainly powered from the github star-count. So matches in github.com/google/guava get prefernce over matches in android.googlesource.com/platform/external/guava, even though the content is the same.

    The problem is that matches have quality. If you are looking for "idiot", then the word "idiot" in an unimportant shard is a better match than the identifier "bidiOther" in an important shard.

    If you increase the result count to include the unimportant shard, inevitably, this will upset the ordering.

    One way out of this is to have a cheaper way to find quality matches. For example, currenltly we have
    a section for file names, and file contents. If you add a separate corpus section for symbols (which would be smaller than file contents), you could search more shards with the same amount of CPU

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0