
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
trie_elastic_search
Advanced tools
This project implements ElasticSearch features using the Trie data structure, providing efficient and fast searching capabilities on large datasets. The Trie data structure is leveraged for optimal search performance, and the project is built with React.j
This npm package provides a custom React hook for implementing Elasticsearch-like search features using the Trie data structure. It is designed to efficiently retrieve data on a large dataset.
https://elastic-search-sage.vercel.app/
To use this package in your React project, you can install it using npm:
npm install elastic_search
import { useElasticSearch } from "trie_elastic_search/src/index";
Import the useTrieSearch hook in your React component and use it as follows:
import { useState } from "react";
import "./App.css";
import data from "./data/data.json";
import { useElasticSearch } from "trie_elastic_search/src/index";
function App() {
const [search, setSearch] = useState("");
const [suggestions, setSuggestions] = useState([]);
const handleChange = (e) => {
console.log("search", search);
setSearch(e.target.value);
};
useElasticSearch(search, setSuggestions, data, 10);
return (
<div className="App">
<div className="search-bar">
<h1 className="header">Elastic Search</h1>
<input
value={search}
className="search-input"
name={"search"}
onChange={(e) => {
handleChange(e);
}}
/>
{suggestions.length > 0 && (
<div className="search-suggestion">
{suggestions.map((item, key) => {
return <p key={key}>{item}</p>;
})}
</div>
)}
</div>
</div>
);
}
export default App;
useElasticSearch() A custom React hook that provides Trie-based search functionality.
searchKeyword (string): The searching keyword.
updateStateCallback (function): A callback function that updates the state with the search results.
data : Data on which we have to do the search query .
numberOfEntries (optional, number): The number of entries to retrieve (default is 10 if not passed).
Always welcomed . create a pull request with proper desciption . Connect with developers for more understanding of the project Profile
For more refences you can visit the github link Github Link
FAQs
This project implements ElasticSearch features using the Trie data structure, providing efficient and fast searching capabilities on large datasets. The Trie data structure is leveraged for optimal search performance, and the project is built with React.j
The npm package trie_elastic_search receives a total of 1 weekly downloads. As such, trie_elastic_search popularity was classified as not popular.
We found that trie_elastic_search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.