# Include modified buffers in semantic search results \(\#2970\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a1250b8525102820c49e1ace9f96c9c66418988f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a1250b8525102820c49e1ace9f96c9c66418988f

Requested commit: a1250b8525102820c49e1ace9f96c9c66418988f

Commit: a1250b8525102820c49e1ace9f96c9c66418988f

Tree: 119f7422d1d805dc8085eceb8f8226d859c41822

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Include modified buffers in semantic search results (#2970)

This pull request introduces an additional step to
`SemanticIndex::search_project` that includes the content of buffers
that are modified but haven't been saved yet. In most cases, the buffer
will contain a small portion of changed spans that are potentially not
included in the index. To reuse all the other spans that haven't
changed, we will query the database for embeddings by their digest. This
means we have to index spans by their digest, which means some penalty
when writing, but in our tests this didn't seem to make indexing much
slower.

Release Notes:

- Improved semantic search to include results from modified buffers.
(preview-only)
```

## Parents

- [8d3c251cc2568981c078decb4adde3a3183be52c](https://git.cafe/gitcafe/zed/commit/8d3c251cc2568981c078decb4adde3a3183be52c?format=markdown)

- [ae85a520f2673892397da04b26e8d880601ac865](https://git.cafe/gitcafe/zed/commit/ae85a520f2673892397da04b26e8d880601ac865?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a1250b8525102820c49e1ace9f96c9c66418988f?format=markdown)
