google / zoekt

Fast trigram based code search
1.67k stars 113 forks source link

zoekt cannot list enough search results #123

Closed dna2github closed 3 years ago

dna2github commented 3 years ago

we find that zoekt cannot list enough search results to match the page number for example num=50.

how to reproduce:

the latter results are not in the former one. this issue also exists not only for regular expression but also for a simple word search. and it can be resolved by increasing the num; however, it does not match the page number (page_size = 50, file_match < 50, doc_match < 50).

{
      "query": "r:z.node set_.*_cache",
      "page_size": 50,
      "file_match": 10,
      "ngram_match": 5844,
      "doc_match": 21,
      "doc_n": 10
}
{
      "query": "r:z.node set_.*_cache",
      "page_size": 100,
      "file_match": 51,
      "ngram_match": 19362,
      "doc_match": 108,
      "doc_n": 51
}
hanwen commented 3 years ago

this UI looks unfamiliar, and https://cs.bazel.build/search?q=r%3Azoekt+page_size shows that zoekt doesnt contain the symbol "page_size", and the query language doesn't support the "project:" atom. Which software are you reporting bugs for?

hanwen commented 3 years ago

typically, the search is abandoned after enough "interesting" matches (ie. symbol definitions) are returned. If this happens, the Zoekt UI will print a "show more" link.

dna2github commented 3 years ago

actually it is from customized template:

   "stat" : {
      {{if .Stats.Crashes}}"crashes": "{{.Stats.Crashes}}",{{end}}
      "query": "{{.Last.Query}}",
      "page_size": {{.Last.Num}},
      "file_match": {{len .FileMatches}},
      "ngram_match": {{.Stats.NgramMatches}},
      "doc_match": {{.Stats.MatchCount}},
      "doc_n": {{.Stats.FileCount}},
      {{if .Stats.Wait}}"wait": {{.Stats.Wait}},{{end}}
      {{if .Stats.FilesSkipped}}"file_skipped": {{.Stats.FilesSkipped}},{{end}}
      {{if .Stats.ShardsSkipped}}"shard_skipped": {{.Stats.ShardsSkipped}},{{end}}
      "file_considered": {{.Stats.FilesConsidered}},
      "file_loaded": {{.Stats.FilesLoaded}},
      "duration": "{{.Stats.Duration}}"
   },