Setting term separators, analyzers with java api

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting term separators, analyzers with java api

feridcelik
Hi,

Im unable to get facets as I expected.
We store products on ES, products got tags like 'body', 'sneakers', 't-shirt', ext..

When i get term facets on the "tag" field, "t-shirt" tag separated into two terms because of '-' character.

How do i disable these separators?
I tried to set different analyzers but couldnt accomplish.

We are using ES 0.19.3

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Setting term separators, analyzers with java api

Michael Sick
set the mapping for the field to not_analyzed, something like:

                "foo-field" : { "type" : "string", "index" : "not_analyzed", "store" : "yes", "include_in_all" : true},

If you need both analyzed and not analyzed versions, see the multi_field option.

--Mike

On Tue, May 22, 2012 at 10:05 AM, feridcelik <[hidden email]> wrote:
Hi,

Im unable to get facets as I expected.
We store products on ES, products got tags like 'body', 'sneakers',
't-shirt', ext..

When i get term facets on the "tag" field, "t-shirt" tag separated into two
terms because of '-' character.

How do i disable these separators?
I tried to set different analyzers but couldnt accomplish.

We are using ES 0.19.3

Thanks.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Setting-term-separators-analyzers-with-java-api-tp4006715.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Setting term separators, analyzers with java api

kimchy
Administrator
Note that store set to yes is not really needed.

On Tue, May 22, 2012 at 5:27 PM, Michael Sick <[hidden email]> wrote:
set the mapping for the field to not_analyzed, something like:

                "foo-field" : { "type" : "string", "index" : "not_analyzed", "store" : "yes", "include_in_all" : true},

If you need both analyzed and not analyzed versions, see the multi_field option.

--Mike

On Tue, May 22, 2012 at 10:05 AM, feridcelik <[hidden email]> wrote:
Hi,

Im unable to get facets as I expected.
We store products on ES, products got tags like 'body', 'sneakers',
't-shirt', ext..

When i get term facets on the "tag" field, "t-shirt" tag separated into two
terms because of '-' character.

How do i disable these separators?
I tried to set different analyzers but couldnt accomplish.

We are using ES 0.19.3

Thanks.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Setting-term-separators-analyzers-with-java-api-tp4006715.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Setting term separators, analyzers with java api

feridcelik
Thanks guys, i set that field as "not_analyzed" and facet results are based on actual field values.

Now i got more questions :)

- Does that "not_analyzed" thing affect search results ? 

- My documents are quite small (~10 fields and small values) and i need most of the fields loaded on search results. Do i need to set {"store":"yes"} for better performance?

Thanks.

Ferid Gürbüz


On Fri, May 25, 2012 at 11:27 PM, kimchy [via ElasticSearch Users] <[hidden email]> wrote:
Note that store set to yes is not really needed.

On Tue, May 22, 2012 at 5:27 PM, Michael Sick <[hidden email]> wrote:
set the mapping for the field to not_analyzed, something like:

                "foo-field" : { "type" : "string", "index" : "not_analyzed", "store" : "yes", "include_in_all" : true},

If you need both analyzed and not analyzed versions, see the multi_field option.

--Mike

On Tue, May 22, 2012 at 10:05 AM, feridcelik <[hidden email]> wrote:
Hi,

Im unable to get facets as I expected.
We store products on ES, products got tags like 'body', 'sneakers',
't-shirt', ext..

When i get term facets on the "tag" field, "t-shirt" tag separated into two
terms because of '-' character.

How do i disable these separators?
I tried to set different analyzers but couldnt accomplish.

We are using ES 0.19.3

Thanks.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Setting-term-separators-analyzers-with-java-api-tp4006715.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.





If you reply to this email, your message will be added to the discussion below:
http://elasticsearch-users.115913.n3.nabble.com/Setting-term-separators-analyzers-with-java-api-tp4006715p4015870.html
To unsubscribe from Setting term separators, analyzers with java api, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Setting term separators, analyzers with java api

kimchy
Administrator
No, you don't need store to be set to yes for better performance, since it plays no part when searching, only when loading a relevant hit to be returned to the user (and if a field is not explicitly stored, it will be fetched from _source).

On Sat, May 26, 2012 at 2:28 PM, feridcelik <[hidden email]> wrote:
Thanks guys, i set that field as "not_analyzed" and facet results are based on actual field values.

Now i got more questions :)

- Does that "not_analyzed" thing affect search results ? 

- My documents are quite small (~10 fields and small values) and i need most of the fields loaded on search results. Do i need to set {"store":"yes"} for better performance?

Thanks.

Ferid Gürbüz


On Fri, May 25, 2012 at 11:27 PM, kimchy [via ElasticSearch Users] <[hidden email]> wrote:
Note that store set to yes is not really needed.

On Tue, May 22, 2012 at 5:27 PM, Michael Sick <[hidden email]> wrote:
set the mapping for the field to not_analyzed, something like:

                "foo-field" : { "type" : "string", "index" : "not_analyzed", "store" : "yes", "include_in_all" : true},

If you need both analyzed and not analyzed versions, see the multi_field option.

--Mike

On Tue, May 22, 2012 at 10:05 AM, feridcelik <[hidden email]> wrote:
Hi,

Im unable to get facets as I expected.
We store products on ES, products got tags like 'body', 'sneakers',
't-shirt', ext..

When i get term facets on the "tag" field, "t-shirt" tag separated into two
terms because of '-' character.

How do i disable these separators?
I tried to set different analyzers but couldnt accomplish.

We are using ES 0.19.3

Thanks.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Setting-term-separators-analyzers-with-java-api-tp4006715.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.





If you reply to this email, your message will be added to the discussion below:
http://elasticsearch-users.115913.n3.nabble.com/Setting-term-separators-analyzers-with-java-api-tp4006715p4015870.html
To unsubscribe from Setting term separators, analyzers with java api, click here.
NAML



View this message in context: Re: Setting term separators, analyzers with java api

Sent from the ElasticSearch Users mailing list archive at Nabble.com.