lexical-lsp / lexical

Lexical is a next-generation elixir language server
782 stars 77 forks source link

Add prefix search functionality to the search store #632

Closed scottming closed 3 months ago

scottming commented 4 months ago

Description:

This commit adds the prefix function to the Lexical.RemoteControl.Search.Store module, allowing for searching entries by prefix. It also implements the find_by_prefix callback in the Lexical.RemoteControl.Search.Store.Backends.Ets module.

Changes:

scohen commented 4 months ago

What about all the places we use subject?

scottming commented 4 months ago

What about all the places we use subject?

@scohen I'm not sure if I've understood your question correctly, but regarding how to handle the places where 'subject' was previously used, we continue to use find_by_subject to query a specific subject.

scohen commented 4 months ago

I think i was a little nervous, your're not actually changing the subject that resides in the Entry to a list, just the key in the ETS table.

I think this will require a reindex, correct?

scottming commented 4 months ago

I think this will require a reindex, correct?

yes, Yes, if we don't do a reindex, then references will be unavailable. How can we enforce this?

scohen commented 4 months ago

We'll need to divorce migrations from schemas, or create a new schema that's just like the old one, but with a migration

scottming commented 4 months ago

We'll need to divorce migrations from schemas, or create a new schema that's just like the old one, but with a migration

@scohen To be honest, I'm not sure how to properly achieve this. Adding a new version of the Schema and defining some migration logic in it could achieve this purpose, but it seems like this would duplicate a lot of the code in v2. Is this what you want?

Updated: added a new schema.

scohen commented 3 months ago

@scottming the new schema is the right call, I'm sorry I said it wasn't the way to go earlier.