{"id":21037210,"url":"https://github.com/kadnan/fehrist","last_synced_at":"2025-05-15T14:32:25.112Z","repository":{"id":57557495,"uuid":"270304137","full_name":"kadnan/Fehrist","owner":"kadnan","description":"Document Indexing and Searching Library in Go","archived":false,"fork":false,"pushed_at":"2020-06-07T16:46:18.000Z","size":19,"stargazers_count":19,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T10:51:17.458Z","etag":null,"topics":["go","golang","indexing","inverted-index"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kadnan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-07T12:47:53.000Z","updated_at":"2024-08-10T00:02:40.000Z","dependencies_parsed_at":"2022-08-28T09:32:34.024Z","dependency_job_id":null,"html_url":"https://github.com/kadnan/Fehrist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadnan%2FFehrist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadnan%2FFehrist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadnan%2FFehrist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadnan%2FFehrist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kadnan","download_url":"https://codeload.github.com/kadnan/Fehrist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254358929,"owners_count":22058016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","indexing","inverted-index"],"created_at":"2024-11-19T13:24:56.480Z","updated_at":"2025-05-15T14:32:24.754Z","avatar_url":"https://github.com/kadnan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fehrist\n[![Build Status](https://api.travis-ci.org/kadnan/fehrist.svg)](https://travis-ci.org/kadnan/fehrist)\n\n_Fehrist_ is a pure Go library for indexing different types of documents. Currently it supports only CSV and JSON but flexible architecture gives you liberty to add more documents. Fehrist(فہرست) is an Urdu word for **Index**. Similar terminologies used in Arabic(فھرس) and Farsi(فہرست) as well.\n\nFehrist is based on [Inverted Index](https://en.wikipedia.org/wiki/Inverted_index) data structure for indexing purposes.\n\n## Examples\n### For indexing\n```\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/kadnan/fehrist/fehrist\"\n)\nfunc main() {\n\tpath, _ := os.Getwd()\n    \n    //Indexing CSV Files\n    CSVDocument := \u0026fehrist.CSV{IndexName: \"local\"}\n\tfor i := 1; i \u003c 3; i++ {\n\t\tfileName := path + \"/\" + strconv.Itoa(i) + \".csv\"\n\t\tfmt.Println(\"Indexing CSV data from the file,\", fileName, \". Please wait...\")\n\n\t\tindexCount, err := CSVDocument.Index(fileName)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t} else {\n\t\t\tfmt.Println(\"Total Words indexed\", indexCount)\n\t\t}\n\t}\n\n    //Indexing JSON files\n\tJSONDocument := \u0026fehrist.JSON{IndexName: \"local\"}\n\tfor i := 1; i \u003c 3; i++ {\n\t\tfileName := path + \"/\" + strconv.Itoa(i) + \".json\"\n\t\tfmt.Println(\"Indexing CSV data from the file,\", fileName, \". Please wait...\")\n\n\t\tindexCount, err := JSONDocument.Index(fileName)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t} else {\n\t\t\tfmt.Println(\"Total Words indexed\", indexCount)\n\t\t}\n\t}\n}\n```\n\n### For Searching\n```\n/* Searching Documents */\n\n\tCSVDocument.Init()\n\tresult, _, err := CSVDocument.Search(\"siddiqi\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(\"Printing the text present in CSV Document\")\n\tfmt.Println(result)\n```\nIf you want to learn how this all work then visit the [blog post](http://blog.adnansiddiqi.me/fehrist-document-indexing-library-in-go/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadnan%2Ffehrist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkadnan%2Ffehrist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadnan%2Ffehrist/lists"}