Specifying Analyzer

I define an analyzer in config/elasticsearch.json like so:

{
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [ "synonym" ]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt"
}
}
}
}
}

I know that this part is processed when ES is starting up because when
there is no file at synonyms.txt I see the error in the console and the
error goes away when the file is there -- so far so good.

it is my understanding that the name of that analyzer is "synonym"
(please correct me if I'm wrong).

now I'm trying to access that analyzer like so:

http://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

but I get an error 400 - ElasticSearchIllegalArgumentException[failed to
find analyzer [synonym]]

what am I doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

You can use a custom analyzer in the Analysis API only after it has been
mapped to a field in an index. You don't need to analysis on this field,
but the analyzer is not used unless an index that uses it has been created.

--
Ivan

On Tue, Jun 18, 2013 at 7:03 PM, Igal @ getRailo.org igal@getrailo.orgwrote:

I define an analyzer in config/elasticsearch.json like so:

{
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [ "synonym" ]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt"
}
}
}
}
}

I know that this part is processed when ES is starting up because when
there is no file at synonyms.txt I see the error in the console and the
error goes away when the file is there -- so far so good.

it is my understanding that the name of that analyzer is "synonym" (please
correct me if I'm wrong).

now I'm trying to access that analyzer like so:

http://localhost:9200/_**analyze?text=this+is+a+test&**analyzer=synonymhttp://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

but I get an error 400 - ElasticSearchIllegalArgumentEx**ception[failed
to find analyzer [synonym]]

what am I doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

--
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 elasticsearch+unsubscribe@**googlegroups.comelasticsearch%2Bunsubscribe@googlegroups.com
.
For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

thanks Ivan,

so how would I map it to a field?

I tried:

PUT /testindex/_mapping
{
"mappings" : {
"type1" : {
"properties" : {
"field1" : { "type" : "string", "analyzer" : "synonym" }
}
}
}
}

but I get an error 500 -- ElasticSearchIllegalArgumentException: failed to
find analyzer [synonym]

On Tuesday, June 18, 2013 7:39:09 PM UTC-7, Ivan Brusic wrote:

You can use a custom analyzer in the Analysis API only after it has been
mapped to a field in an index. You don't need to analysis on this field,
but the analyzer is not used unless an index that uses it has been created.

--
Ivan

On Tue, Jun 18, 2013 at 7:03 PM, Igal @ getRailo.org <ig...@getrailo.org<javascript:>

wrote:

I define an analyzer in config/elasticsearch.json like so:

{
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [ "synonym" ]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt"
}
}
}
}
}

I know that this part is processed when ES is starting up because when
there is no file at synonyms.txt I see the error in the console and the
error goes away when the file is there -- so far so good.

it is my understanding that the name of that analyzer is "synonym"
(please correct me if I'm wrong).

now I'm trying to access that analyzer like so:

http://localhost:9200/_**analyze?text=this+is+a+test&**analyzer=synonymhttp://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

but I get an error 400 - ElasticSearchIllegalArgumentEx**ception[failed
to find analyzer [synonym]]

what am I doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

--
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 elasticsearc...@**googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Have you tried using the index in the analysis call?

http://localhost:9200/*testindex*/_**analyze?text=this+is+a+test&**
analyzer=synonymhttp://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

On Tue, Jun 18, 2013 at 8:14 PM, Igal dev@21solutions.net wrote:

thanks Ivan,

so how would I map it to a field?

I tried:

PUT /testindex/_mapping
{
"mappings" : {
"type1" : {
"properties" : {
"field1" : { "type" : "string", "analyzer" : "synonym" }
}
}
}
}

but I get an error 500 -- ElasticSearchIllegalArgumentException: failed to
find analyzer [synonym]

On Tuesday, June 18, 2013 7:39:09 PM UTC-7, Ivan Brusic wrote:

You can use a custom analyzer in the Analysis API only after it has been
mapped to a field in an index. You don't need to analysis on this field,
but the analyzer is not used unless an index that uses it has been created.

--
Ivan

On Tue, Jun 18, 2013 at 7:03 PM, Igal @ getRailo.org ig...@getrailo.orgwrote:

I define an analyzer in config/elasticsearch.json like so:

{
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [ "synonym" ]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt"
}
}
}
}
}

I know that this part is processed when ES is starting up because when
there is no file at synonyms.txt I see the error in the console and the
error goes away when the file is there -- so far so good.

it is my understanding that the name of that analyzer is "synonym"
(please correct me if I'm wrong).

now I'm trying to access that analyzer like so:

http://localhost:9200/_**analyze**?text=this+is+a+test&**analyzer=**
synonymhttp://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

but I get an error 400 - ElasticSearchIllegalArgumentEx****ception[failed
to find analyzer [synonym]]

what am I doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

--
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 elasticsearc...@googlegroups.com.

For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I tried now. I get an error:

{"error":"ElasticSearchIllegalArgumentException[failed to find analyzer [synonym]]","status":400}

which makes sense because the previous call (to create the index) failed.

On Tuesday, June 18, 2013 8:18:13 PM UTC-7, Ivan Brusic wrote:

Have you tried using the index in the analysis call?

http://localhost:9200/*testindex*/_**analyze?text=this+is+a+test&**
analyzer=synonymhttp://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

On Tue, Jun 18, 2013 at 8:14 PM, Igal <d...@21solutions.net <javascript:>>wrote:

thanks Ivan,

so how would I map it to a field?

I tried:

PUT /testindex/_mapping
{
"mappings" : {
"type1" : {
"properties" : {
"field1" : { "type" : "string", "analyzer" : "synonym" }
}
}
}
}

but I get an error 500 -- ElasticSearchIllegalArgumentException: failed
to find analyzer [synonym]

On Tuesday, June 18, 2013 7:39:09 PM UTC-7, Ivan Brusic wrote:

You can use a custom analyzer in the Analysis API only after it has been
mapped to a field in an index. You don't need to analysis on this field,
but the analyzer is not used unless an index that uses it has been created.

--
Ivan

On Tue, Jun 18, 2013 at 7:03 PM, Igal @ getRailo.org <ig...@getrailo.org

wrote:

I define an analyzer in config/elasticsearch.json like so:

{
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [ "synonym" ]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt"
}
}
}
}
}

I know that this part is processed when ES is starting up because when
there is no file at synonyms.txt I see the error in the console and the
error goes away when the file is there -- so far so good.

it is my understanding that the name of that analyzer is "synonym"
(please correct me if I'm wrong).

now I'm trying to access that analyzer like so:

http://localhost:9200/_**analyze**?text=this+is+a+test&**analyzer=**
synonymhttp://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

but I get an error 400 - ElasticSearchIllegalArgumentEx****ception[failed
to find analyzer [synonym]]

what am I doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

--
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 elasticsearc...@googlegroups.com.

For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I think your index is not created with the settings you are expecting.
I recommend to use Create Index API: Elasticsearch Platform — Find real-time answers at scale | Elastic

If it does not work, please gist a full curl recreation. Elasticsearch Platform — Find real-time answers at scale | Elastic

Thanks

David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 19 juin 2013 à 05:45, Igal igal@getrailo.org a écrit :

I tried now. I get an error:

{"error":"ElasticSearchIllegalArgumentException[failed to find analyzer [synonym]]","status":400}

which makes sense because the previous call (to create the index) failed.

On Tuesday, June 18, 2013 8:18:13 PM UTC-7, Ivan Brusic wrote:

Have you tried using the index in the analysis call?

http://localhost:9200/testindex/_analyze?text=this+is+a+test&analyzer=synonym

On Tue, Jun 18, 2013 at 8:14 PM, Igal d...@21solutions.net wrote:

thanks Ivan,

so how would I map it to a field?

I tried:

PUT /testindex/_mapping
{
"mappings" : {
"type1" : {
"properties" : {
"field1" : { "type" : "string", "analyzer" : "synonym" }
}
}
}
}

but I get an error 500 -- ElasticSearchIllegalArgumentException: failed to find analyzer [synonym]

On Tuesday, June 18, 2013 7:39:09 PM UTC-7, Ivan Brusic wrote:

You can use a custom analyzer in the Analysis API only after it has been mapped to a field in an index. You don't need to analysis on this field, but the analyzer is not used unless an index that uses it has been created.

--
Ivan

On Tue, Jun 18, 2013 at 7:03 PM, Igal @ getRailo.org ig...@getrailo.org wrote:

I define an analyzer in config/elasticsearch.json like so:

{
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [ "synonym" ]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt"
}
}
}
}
}

I know that this part is processed when ES is starting up because when there is no file at synonyms.txt I see the error in the console and the error goes away when the file is there -- so far so good.

it is my understanding that the name of that analyzer is "synonym" (please correct me if I'm wrong).

now I'm trying to access that analyzer like so:

http://localhost:9200/_analyze?text=this+is+a+test&analyzer=synonym

but I get an error 400 - ElasticSearchIllegalArgumentException[failed to find analyzer [synonym]]

what am I doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

--
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 elasticsearc...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.