Hello all,
we are trying to implement a SIREn plugin for ElasticSearch for indexing
and querying documents. We already implemented a version which uses SIREn
to index and query a specific field (called "contents" below) which
contains a JSON document as a string. An example of a doc:
{
"id":3,
"contents":
"{\"title\":\"This is an another article about SIREn.\",\"content\":\"bla bla
bla \"}"
}
Instead, we would like to index the whole document as it is posted to
ElasticSearch to avoid the need for a special loader that transforms an
input JSON to the required form. So then the user would simply post a
document such as:
{
"id":3,
"title":"This is an another article about SIREn.",
"content": "bla bla bla "
}
and it would be indexed as a whole both by ElasticSearch and by the SIREn
plugin.
One problem we encountered is that it is not possible to use copyTo for the
_source field and then only configure an analyzer for the copy.
It seems that the cleanest solution would be to modify the
SourceFieldMapper class to allow copyTo.
As a workaround we are going to create a class that extends
SourceFieldMapper and set copyTo for the _source field to a new field that
will be then used for SIREn and register it as follows:
mapperService.documentMapperParser().putRootTypeParser("_source", new
ModifiedSourceFieldMapper.TypeParser());
Does it sound OK or is there a simpler/cleaner solution?
Thank you in advance,
Jakub
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/352e7668-d382-4ca3-bbeb-605d6c019ed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.