Reputation: 3887
I would like to tag particular entities from Elastic. Is this supported? e.g. For the text:
Hello my name is Johnny
To tag it to the tokens
Hello
my
name
is
johnny < person
And later highlight those entities? Does anyone know of such thing or plugin or any point of direction would help.
Upvotes: 2
Views: 1782
Reputation: 1494
Elasticsearch does not do named entity recognition. You could use an ingest processor, though, similar to this one https://github.com/spinscale/elasticsearch-ingest-opennlp (though you would probably have to modify it for your exact use case).
However, you're probably better off doing named entity recognition before indexing your documents. You could try openNLP or NLTK, or if it's a non-commercial project, the Stanford NER. I think you want to add the "highlight" tags yourself, also before indexing. I'm thinking of something like this:
<ne type="person">Johnny</ne> is from <ne type="place">New York</ne>
You can use a custom analyzer to discard the tags for analysis, or simply index two fields, one without the tags.
Upvotes: 2