Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAT-70] feat: Do not use flexsearch store #2623

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paultranvan
Copy link
Contributor

Flexsearch has a built-in store capability, in order to store the full content of indexed documents.
This is useful, however, this takes extra memory for nothing, as we already have the cozy-client store. All the indexed documents for the search are supposed to exist in cozy-client store, as we query them from Pouch at init, and retrieve updates from realtime, already plugged in cozy-client.

Flexsearch has a built-in store capability, in order to store the full
content of indexed documents.
This is useful, however, this takes extra memory for nothing, as we
already have the cozy-client store. All the indexed documents for the
search are supposed to exist in cozy-client store, as we query them from
Pouch at init, and retrieve updates from realtime, already plugged in
cozy-client.
@paultranvan paultranvan changed the title feat: Do not use flexsearch store [DAT-70] feat: Do not use flexsearch store Nov 21, 2024
Comment on lines +365 to +381
/*
Search result example:
[
{
"field": "displayName",
"result": [
"604627c6bafee013ec5f27f7f72029f6"
]
},
{
"field": "fullname",
"result": [
"604627c6bafee013ec5f27f7f72029f6", "604627c6bafee013ec5f27f3f714568"
]
}
]
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was that comment expected to be commited?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was, it does not look like a good practice, but I honestly felt like it was helpful to better grasp the expected result quickly

@@ -179,14 +180,13 @@ export class SearchEngine {
const fieldsToIndex = SEARCH_SCHEMA[doctype]

const flexsearchIndex = new FlexSearch.Document<CozyDoc, true>({
tokenize: 'forward',
tokenize: 'full',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this change is not documented in the commit message and is not part of the "do not use flexsearch store" scope. Maybe you can add some precision in the commit message or extract it in another commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my, it's a mistake, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants