sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.27k forks source link

Streaming search: smarter search suggestion parsing #17789

Open limitedmage opened 3 years ago

limitedmage commented 3 years ago

Currently, search suggestions coming from streaming search "skipped items" are simply appended to the end of the query. This is not ideal and causes issues such as adding a second count: filter to the query, which is not allowed by our search language. We need to modify the way search suggestions are added to the query to make them syntax-aware, eg. by replacing existing filters if they already exist.

This is sort of fixed by #19645 with the use of applyAdditionalFilters but could fail if the additional filters are move complex.

github-actions[bot] commented 3 years ago

Heads up @lguychard - the "team/search" label was applied to this issue.

lguychard commented 2 years ago

@fkling I believe you've done some work in this area. Is this still relevant?

fkling commented 2 years ago

@lguychard I think so because what I did was only applied to the search sidebar. I think these suggestions use a different code path?

limitedmage commented 2 years ago

This is still relevant because this is for the suggestions coming from "skipped search results" warnings. However, most of the problems of the current implementation have been addressed by letting suggestions for count: override existing ones. So I think this is super low priority (or should be closed at this point, and maybe reopened if we want to make skipped result suggestions more complex).