Not sure what the plugin is doing, but if you want to process dedicated
JSON data in an ES document, you could prepare an analyzer for a new field
type. So user can assign special meaning in the mapping to a field of their
preference.

E.g.  a mapping with

     "mappings: {
         "mycontent" : { "type" : "siren" }
    }

and a given document would look like

    "mycontent" : {
         "title" : "foo",
         "name" : "bar"
         ...
    }


and then you could extract the whole JSON subdoc from the doc under
"mycontent" into your analyzer plugin and process it.

For an example, you could look into plugins like the StandardNumber
analyzer, where I defined a new type "standardnumber" for analysis:

https://github.com/jprante/elasticsearch-analysis-standardnumber/blob/master/src/main/java/org/xbib/elasticsearch/index/mapper/standardnumber/StandardNumberMapper.java

Jörg



On Fri, May 23, 2014 at 4:48 PM, Jakub Kotowski <[email protected]>wrote:

> 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<https://groups.google.com/d/msgid/elasticsearch/352e7668-d382-4ca3-bbeb-605d6c019ed1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKdsXoF1jgfGYtfkm7A6rqMCJzGyw8OtZraxhbzyARK_TYhykQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to