Skip to content

Search type doesn't work properly

Summary

While working on Experiment with LLM judge for code search results (#474127 - closed) I've discovered that I see exactly the same results with different search_type

Steps to reproduce

  1. Open search with search_type=zoekt https://gitlab.com/api/v4/projects/278964/search?scope=blobs&per_page=10&search_type=zoekt&search=query_time
  2. Open search with search_type=advanced https://gitlab.com/api/v4/projects/278964/search?scope=blobs&per_page=10&search_type=advanced&search=query_time
  3. You'll see exactly the same set of results

The same can be reproduced in the UI:

  1. https://gitlab.com/search?search=query_time&nav_source=navbar&project_id=278964&group_id=9970&search_code=true&repository_ref=master&search_type=advanced
  2. https://gitlab.com/search?search=query_time&nav_source=navbar&project_id=278964&group_id=9970&search_code=true&repository_ref=master&search_type=zoekt

UI says it uses a different search engine, but results are the same.

What is the current bug behavior?

search_type is not respected

What is the expected correct behavior?

search_type should be respected

Relevant logs and/or screenshots

Screenshot with different set of results when you use preferences to disable/enable Zoekt:

image

Possible fixes

Edited by Dmitry Gruzd