In this post, I try to reproduce the article “Let’s build a Full-Text Search engine” to learn more about full-text search databases and Rust. Pl

Learning Rust - creating a full-text search engine

submited by
Style Pass
2022-05-16 11:30:17

In this post, I try to reproduce the article “Let’s build a Full-Text Search engine” to learn more about full-text search databases and Rust. Please note: I graduated in computer engineering, the C language was the first language I ever saw in my life, and I use Python and JS daily. That’s the angle I will be using through the post.

Goal number one is to read some data from an XML export, after that load it in memory and perform searches on it. As a data source, I’m using the same part of the abstract of English Wikipedia described in the original article, with over 600K documents.

Google: “rust read xml file”. Check posts. Links led me to crates.io and to the quick-xml crate. More research also resulted in good answers (https://simplabs.com/blog/2020/12/31/xml-and-rust/) which taught me different ways to parse files and different crates to use.

Something that caught my attention is that you need to be intentional about passing parameters by reference or by value. The Path initializer expects a reference and not a struct std::string::String.

Leave a Comment