Skip to content

UI and API /search return vastly different result sizes in project-less mode #3170

Open
@mkboudreau

Description

@mkboudreau

Describe the bug
It does not seem like the API and the UI are returning the same results. Maybe I'm missing something, but when I search for the exact same thing from the UI and the API I get 125 results from the API and 9,708 from the UI. Something seems not right.

To Reproduce
Try /search?... and /api/v1/search?... with all the same query parameters. In my test only full= was set.

Expected behavior
I expect the UI and the REST API to return the same results

Screenshots

  • UI in Browser

URL: http://local-opengrok/search?full=test&defs=&refs=&path=&type=

image

  • API in terminal

URL: http://local-opengrok/api/v1/search?full=test&defs=&refs=&path=&type=

curl -s 'http://local-opengrok/api/v1/search?full=test&defs=&refs=&path=&type=' | jq .resultCount
125
curl -s 'http://local-opengrok/api/v1/search?full=test&defs=&refs=&path=&type=' | jq 
{
  "time": 167,
  "resultCount": 125,
  "startDocument": 0,
  "endDocument": 124,
  "results": {
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions