Skip to content

Commit

Permalink
Update README for indexing additional fields (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
x389liu authored Nov 1, 2020
1 parent 062f3b1 commit 8172015
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8172015

Please sign in to comment.