© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
17 replies
bootzin

✅ Help optimizing finding keywords in text

I currently have a huge document database, and want to go through each of them and find matching keywords (which are user defined).
Documents are usually 5k~10k words long. I am currently doing a string.contains, but it has a very bad performance
My initial attempt was to build a trie for each document, which worked almost perfectly, but with a major problem: some keywords are compound (i.e: "bag of words")
Word context/ordering is important enough that simply checking of all the words independently didn't work ("bag" AND "of" AND "words")
Any ideas?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Finding text in json files
C#CC# / help
3y ago
WPF TextBlock Text binding
C#CC# / help
2y ago
Optimizing requests MyAnimeList - need help
C#CC# / help
7mo ago
TextFile Help
C#CC# / help
3y ago