Simple invert index implemention, Use the Gin framework to do the RESTful API. In here provide Add and Search operation.
The Add API will input the filename which need to append to the invert index this file should have the particular restriction, when new the invert index server, User can input the parameter as the search key word. for example if use the "ID", "Name", "title" as the key word. The file header should like
ID:`value`
Name:`value`
title:`value`
then will use the key word and timestamp to hash as the document ID and all the key word is the invert index key the document ID is value. finally rename the input file name to document for easy to read.
input the key word then will return the document ID or nothing.
go get github.com/Noahnut/invertIndex
- create the invertIndex struct
- New the server and input the what search word want to read from the file
in := invert.InvertIndex{}
in.NewInvertIndex("ID", "Name", "title")
POST
GET