In this last week, I wanted to try OramaSearch, a new library that is really easy to use to implement fulltext searches.
I wanted to do two simple tests to verify its ease of use and if indeed, as the authors promise, provide results so quickly.
The first test was to create an Angular project, add a service that downloaded a structured JSON of data (in my case related to a list of states of the world), and then use Orama to filter the data based on a text string.
The steps to include and use Orama are:
- create an angular project
- install OramaSearch
- create a service to download data from a webservice In my case I used https://restcountries.com, an Open Source project and free to use, to get country information via a RESTful API.
- create a database with the desired schema
- through the service, populate the database
- create an interface to display the data list, including search fields (in my case I used AngularMaterial to speed up writing the UI)
- implement search method
If you want to see the complete project, you can find it here https://github.com/eleonorarocchi/oramaDemo
The second test was to implement a NodeJs project.
As in the previous example, I tried including CountryREST to populate the database, and implement a search method.
The steps to include and use Orama are:
- initialize it as an npm project:
- install and set up TypeScript
- create tsconfig.json
- install the Express framework and create a minimal server
- create src/app.ts file
- in the app.listen method, add the code for initialize the database definition, as in the previous project, and the code for populate database
- create a method for see all data
- create a method for see filtered data, by a parameter
It's really simple to integrate and fast to deliver results!
If you want to see the complete project, you can find it here https://github.com/eleonorarocchi/oramaNodeDemo
You can find more information directly on the project website: https://www.oramasearch.com
Top comments (0)