An Inverted Index is a data structure used to create full text search.



Task

Given a set of text files, implement a program to create an inverted index.

Also create a user interface to do a search using that inverted index which returns a list of files that contain the query term / terms.

The search index can be in memory.




si = CreateSearchIndex["ExampleData/Text", Method -> "TFIDF"];
Manipulate[Grid[sr = TextSearch[si, ToString[s]];
  {FileBaseName /@ Normal[Dataset[sr][All, "ReferenceLocation"]], 
    Column[#, Frame -> All] & /@ sr[All, "Snippet"]} // Transpose, 
  Frame -> All], {s, "tree"}]