Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In-memory autocomplete. That is, just keep a data structure in memory that contains the previously used input field values on that DDF instance and use it to give autocomplete suggestions. Some quick Google searches revealed a few immature and unmaintained libraries that would give decent suggestions, but they appear to have limited configurability. With this approach, we would also have to figure out a way to make the input field value suggestions persist between DDF restarts—a simple solution would be to write out the phrases to a text file. 

    If we’re okay with having only prefix-based suggestions (i.e. only matching the user’s input against the beginning of the words and phrases available for suggestion), a trie would be a simple solution and there are already some decent implementations available (such as https://github.com/vivekn/autocomplete).

  2. Solr/Lucene suggestions. A separate index, or even a dictionary file (which is just a text file), could be used as the persistence mechanism for the input field value suggestions. Solr has a well-documented “Suggester” component that would make it relatively easy to implement a suggestion service. Lucene also provides suggestion APIs, but using Lucene would likely involve more work than using Solr. This solution would give us the most flexibility in determining how suggestions are curated.

...