I'm having a big struggle to get a Snowball Analyser working on my index...
I'm trying to use the Java API to set the relevant settings/mapping not
even sure which it is any more.
From the website I gathered that I want to set something like this:
... though how exactly and where I do not know. Is this part of the
mapping or the setting of an index? Do I have to define "my_analyzer"?
Surely snowball is popular enough that it is included in the Elasticsearch
project?
I've tried adding the mapping (constructed as a Json object through the
XContentBuilder) to the CreateIndexRequestBuilder object that is linked to
my Index, thought the setSettings() option, but no luck there.
Any help with in this regard would be greatly appreciated.
On Tuesday, March 13, 2012 7:09:17 PM UTC+4, Thinus Prinsloo wrote:
I'm having a big struggle to get a Snowball Analyser working on my
index... I'm trying to use the Java API to set the relevant
settings/mapping not even sure which it is any more.
From the website I gathered that I want to set something like this:
... though how exactly and where I do not know. Is this part of the
mapping or the setting of an index? Do I have to define "my_analyzer"?
Surely snowball is popular enough that it is included in the Elasticsearch
project?
I've tried adding the mapping (constructed as a Json object through the
XContentBuilder) to the CreateIndexRequestBuilder object that is linked to
my Index, thought the setSettings() option, but no luck there.
Any help with in this regard would be greatly appreciated.
I managed (I think) to get it working by setting the analyzer property
during the index create process (as you suggested) with the following Java
code:
mapping_content.field("Text").startObject().field("type",
"string").field("store", "no").field("index", "analyzed").field("analyzer",
"snowball").endObject();
That seems simple enough! Now, not entirely sure if it's actually
working, or just playing along at the moment. What I do need to figure out
is how to set up a query to correctly query data that's been analyzed with
the snowball analyzer.
Thanks again.
On Tuesday, 13 March 2012 17:38:49 UTC+2, k4Rla wrote:
for example u can put two documents in your index with values 'automats'
and 'automatical', and then send a query 'automatic', if you get both
results, it's apparently works. More words for test u can find here http://snowball.tartarus.org/demo.php
On Tuesday, March 13, 2012 7:59:13 PM UTC+4, Thinus Prinsloo wrote:
Thanks k4RIa,
I managed (I think) to get it working by setting the analyzer property
during the index create process (as you suggested) with the following Java
code:
mapping_content.field("Text").startObject().field("type",
"string").field("store", "no").field("index", "analyzed").field("analyzer",
"snowball").endObject();
That seems simple enough! Now, not entirely sure if it's actually
working, or just playing along at the moment. What I do need to figure out
is how to set up a query to correctly query data that's been analyzed with
the snowball analyzer.
Thanks again.
On Tuesday, 13 March 2012 17:38:49 UTC+2, k4Rla wrote:
Unfortunately, i dont know Java (but i really will :D), but to get results
u can help this
or this
On Tuesday, March 13, 2012 7:09:17 PM UTC+4, Thinus Prinsloo wrote:
I'm having a big struggle to get a Snowball Analyser working on my
index... I'm trying to use the Java API to set the relevant
settings/mapping not even sure which it is any more.
From the website I gathered that I want to set something like this:
... though how exactly and where I do not know. Is this part of the
mapping or the setting of an index? Do I have to define "my_analyzer"?
Surely snowball is popular enough that it is included in the Elasticsearch
project?
I've tried adding the mapping (constructed as a Json object through the
XContentBuilder) to the CreateIndexRequestBuilder object that is linked to
my Index, thought the setSettings() option, but no luck there.
Any help with in this regard would be greatly appreciated.
I'm having a big struggle to get a Snowball Analyser working on my
index... I'm trying to use the Java API to set the relevant
settings/mapping not even sure which it is any more.
Firstly, the standard analyzer is for the english language. So you do
not need to define it, it is called for by "standard". Elasticsearch Platform — Find real-time answers at scale | Elastic
The documentation of the Java API could certainly improve IMHO. However,
I sorted out what I wanted to do by looking in the test code that is
part of the source (GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine). I
am sure that if you browse through there you will find solutions that
can be copied directly into your code.
I haven't been using mapping via the API directly myself so I cannot
help with specific code samples. I setup mapping by putting the index
definitions in config/elasticsearch.yml and the mappings in
config/mappings//.json
or if it is a general type mapping that can be used cross several indexes:
config/mappings/_default/.json
For example config/elasticsearch.yml:
index :
number_of_shards : 1
number_of_replicas : 0
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.