From 817201553d790c8b53a3aef17ed87721a9d35595 Mon Sep 17 00:00:00 2001 From: Xinyu Mavis Liu Date: Sun, 1 Nov 2020 12:59:41 -0500 Subject: [PATCH] Update README for indexing additional fields (#239) --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index bfc8cc35f..e04d8735b 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,21 @@ for i in range(len(hits)): print(f'{i+1:2} {hits[i].docid:15} {hits[i].score:.5f}') ``` +You can also add extra fields in your documents when needed, e.g. text features. +For example, the [SpaCy](https://spacy.io/usage/linguistic-features#named-entities) Named Entity Recognition (NER) result of `contents` could be stored as an additional field `NER`. + +```json +{ + "id": "doc1", + "contents": "Apple is looking at buying U.K. startup for $1 billion.", + "NER": { + "ORG": ["Apple"], + "GPE": ["U.K."], + "MONEY": ["$1 billion"] + } +} +``` + Happy honking! ## Additional Documentation