ES-Hadoop jar marking field as not_analyzed


#1

Hi,

How do we mark a field as not_analyzed in pig script itself. For e.g sample "name" field like name marked as not_analyzed in below example:

{
"name": {
"type": "string",
"index": "not_analyzed"
}
}

How can we mark "name" field as not_analyzed while populating through pig script. Sample pig script:

REGISTER /path/elasticsearch-hadoop.jar;

A = LOAD 'src/test/resources/artists.dat' USING PigStorage()
AS (id:long, name, url:chararray, picture: chararray);
-- transform data
B = FOREACH A GENERATE name,url, picture;
-- save the result to Elasticsearch
STORE B INTO 'radio/artists' USING org.elasticsearch.hadoop.pig.EsStorage();

-- TODO name to be marked as not_analyzed

Thanks!


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.