Best way to support wildcard search in a large dictionary?

I am working on a search project in a large dictionary (100k ~ 1m words). Dictionary items look like {key, value, freq}. Myy's goal is to develop an incremental search algorithm to support exact matching, prefix matching, and wildcard matching. Results should be ordered by frequency.

For example: a dictionary looks like

key1=a,value1=v1,freq1=4
key2=ab,value2=v2,freq2=2
key3=abc,value3=v3 freq3=1
key4=abcd,value4=v4,freq4=3

when the user types 'a', returns v1, v4, v2, v3
 when the user enters "a? c", returns v4, v3

Now my best bet is the suffix tree represented by the DAWG data structure, but this method does not support efficient mappings.

Any suggestion?

+3
1

n- . - , Apache Solr, . , ..

0

Source: https://habr.com/ru/post/1733872/


All Articles