From searchHit, use eshit.getFields().get("f1").getValue() to get
the returned search hit field value.
Question 1: Is this the right approach?
Question 2: How to specify "_source : {enable:false} "? I currently
not able to make this work. I am using 0.19.3 and I have specified
this in a mapping file located at /config/mapping/[index name]/[index
type].json. I see the _source when using GET and SEARCH API. I am
using Java client, the searchHit.getSource() returns the full source
store = yes or no. Did I put the config file in the right spot? How
can I use Java client to disable _source?
First, if you want to make sure that your mapping has taken affect, use the
get mapping API after the index has been created, and see the mappings it
returns.
Your solution is fine, can you share (gist) your mapping file? Lets see if
its correct or not. Btw, the location should be [config
path]/mappings/[index_name]/[type].json (note the mappings instead of
mapping).
From searchHit, use eshit.getFields().get("f1").getValue() to get
the returned search hit field value.
Question 1: Is this the right approach?
Question 2: How to specify "_source : {enable:false} "? I currently
not able to make this work. I am using 0.19.3 and I have specified
this in a mapping file located at /config/mapping/[index name]/[index
type].json. I see the _source when using GET and SEARCH API. I am
using Java client, the searchHit.getSource() returns the full source
store = yes or no. Did I put the config file in the right spot? How
can I use Java client to disable _source?
First, if you want to make sure that your mapping has taken affect, use the
get mapping API after the index has been created, and see the mappings it
returns.
Your solution is fine, can you share (gist) your mapping file? Lets see if
its correct or not. Btw, the location should be [config
path]/mappings/[index_name]/[type].json (note the mappings instead of
mapping).
From searchHit, use eshit.getFields().get("f1").getValue() to get
the returned search hit field value.
Question 1: Is this the right approach?
Question 2: How to specify "_source : {enable:false} "? I currently
not able to make this work. I am using 0.19.3 and I have specified
this in a mapping file located at /config/mapping/[index name]/[index
type].json. I see the _source when using GET and SEARCH API. I am
using Java client, the searchHit.getSource() returns the full source
store = yes or no. Did I put the config file in the right spot? How
can I use Java client to disable _source?
First, if you want to make sure that your mapping has taken affect, use the
get mapping API after the index has been created, and see the mappings it
returns.
Your solution is fine, can you share (gist) your mapping file? Lets see if
its correct or not. Btw, the location should be [config
path]/mappings/[index_name]/[type].json (note the mappings instead of
mapping).
From searchHit, use eshit.getFields().get("f1").getValue() to get
the returned search hit field value.
Question 1: Is this the right approach?
Question 2: How to specify "_source : {enable:false} "? I currently
not able to make this work. I am using 0.19.3 and I have specified
this in a mapping file located at /config/mapping/[index name]/[index
type].json. I see the _source when using GET and SEARCH API. I am
using Java client, the searchHit.getSource() returns the full source
store = yes or no. Did I put the config file in the right spot? How
can I use Java client to disable _source?
I found the problem.... a silly one and a minor bug I think.
For those who use gedit to modify your config files and you can't
explain a problem sure you had fixed with changes to the config files,
please read on.
Cause of the problem:
I used ubuntu gedit to edit the mapping file. gedit saves your
previous version of the file into .~. In my case, I changed _source
to be disabled from enabled. So product.json~ is old and product.json
is new. What thrown me off was the fact that my change in the
mapping file did not take effect. I could not explain what was
happening although seem silly, I I removed the product.json~ just to
see if it made any difference. Guess what, what was it. For some
reason, product.json~ was being picked up by elasticsearch and not the
new file product.json. I believe this is a minor bug in the code but
has a bad impact.
Work-around, simply always delete the gedit backup files or using
VI or something else to edit elasticsearch config files.
First, if you want to make sure that your mapping has taken affect, use the
get mapping API after the index has been created, and see the mappings it
returns.
Your solution is fine, can you share (gist) your mapping file? Lets see if
its correct or not. Btw, the location should be [config
path]/mappings/[index_name]/[type].json (note the mappings instead of
mapping).
From searchHit, use eshit.getFields().get("f1").getValue() to get
the returned search hit field value.
Question 1: Is this the right approach?
Question 2: How to specify "_source : {enable:false} "? I currently
not able to make this work. I am using 0.19.3 and I have specified
this in a mapping file located at /config/mapping/[index name]/[index
type].json. I see the _source when using GET and SEARCH API. I am
using Java client, the searchHit.getSource() returns the full source
store = yes or no. Did I put the config file in the right spot? How
can I use Java client to disable _source?
Nasty!, yea, elasticsearch simply iterates through the files, and tries to
parse them by auto detecting the content type, so probably the ~ one was
overriding the other one...
I found the problem.... a silly one and a minor bug I think.
For those who use gedit to modify your config files and you can't
explain a problem sure you had fixed with changes to the config files,
please read on.
Cause of the problem:
I used ubuntu gedit to edit the mapping file. gedit saves your
previous version of the file into .~. In my case, I changed _source
to be disabled from enabled. So product.json~ is old and product.json
is new. What thrown me off was the fact that my change in the
mapping file did not take effect. I could not explain what was
happening although seem silly, I I removed the product.json~ just to
see if it made any difference. Guess what, what was it. For some
reason, product.json~ was being picked up by elasticsearch and not the
new file product.json. I believe this is a minor bug in the code but
has a bad impact.
Work-around, simply always delete the gedit backup files or using
VI or something else to edit elasticsearch config files.
First, if you want to make sure that your mapping has taken affect,
use the
get mapping API after the index has been created, and see the
mappings it
returns.
Your solution is fine, can you share (gist) your mapping file? Lets
see if
its correct or not. Btw, the location should be [config
path]/mappings/[index_name]/[type].json (note the mappings instead of
mapping).
From searchHit, use eshit.getFields().get("f1").getValue() to
get
the returned search hit field value.
Question 1: Is this the right approach?
Question 2: How to specify "_source : {enable:false} "? I
currently
not able to make this work. I am using 0.19.3 and I have specified
this in a mapping file located at /config/mapping/[index
name]/[index
type].json. I see the _source when using GET and SEARCH API. I am
using Java client, the searchHit.getSource() returns the full
source
store = yes or no. Did I put the config file in the right spot?
How
can I use Java client to disable _source?
Question 3: Please confirm the following is what I am experiencing
and
the problem will be fixed in 0.19.4:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.