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

Is there Infix search possible #4

Open
nhaberl opened this issue Jun 14, 2020 · 5 comments
Open

Is there Infix search possible #4

nhaberl opened this issue Jun 14, 2020 · 5 comments

Comments

@nhaberl
Copy link

nhaberl commented Jun 14, 2020

Is there a chance also to look for croso to get results for microsoft?
So not only Prefix search.

@wolfgarbe
Copy link
Owner

wolfgarbe commented Jun 14, 2020

With the current PruningRadixTrie structure there is no infix search possible, unless you want to exhaustively scan the whole trie. It would be possible to modify the structure and the algorithm though: When adding a term to the trie you could also add all the suffixes of the term to the trie. But this would significantly increase memory consumption and lookup time.

@nhaberl
Copy link
Author

nhaberl commented Jun 14, 2020

Ok, arent you already indexing all single characters?
So index size should be the same ?
Why is it heavier to search for chractrrs inside the indexed terms ?

Sorry if I am totally wrong but werent Tries invented to search anywhere ?

You can look here, maybe its somehow important especially the Suffix Trie
https://github.com/npgall/concurrent-trees/blob/master/README.md

@wolfgarbe
Copy link
Owner

wolfgarbe commented Jun 14, 2020

Sorry if I am totally wrong but weren't Tries invented to search anywhere ?

No, Radix tries (prefix tries) are supporting efficient prefix search, and Suffix tries are supporting efficient suffix search, None of them is supporting efficient substring (neither prefix nor suffix) search.

@nhaberl
Copy link
Author

nhaberl commented Jun 19, 2020

Ok thanks, so something similar to the link I've added is not possible anywhere soon ?

@wolfgarbe
Copy link
Owner

I have currently no plans to implement it. But anybody is free to fork the repository and add a substring lookup functionality.

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