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

Stack overflow for very long words #44

Open
mattheww opened this issue May 22, 2022 · 1 comment
Open

Stack overflow for very long words #44

mattheww opened this issue May 22, 2022 · 1 comment

Comments

@mattheww
Copy link

If I add a very long word to the index (8000 characters is enough on my machine), I get a stack overflow while serialising it.

Here's how I was testing:

fn main() {
    let mut index = Index::new(&["body"]);
    let long_string = "a".repeat(8000);
    index.add_doc("1", &[long_string]);
    index.to_json_pretty();
}
@mattico
Copy link
Owner

mattico commented May 22, 2022

I suggest you use https://github.com/dtolnay/serde-stacker to convert the index to JSON. I don't think I want to make this the default behavior.

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

No branches or pull requests

2 participants