Analyzer setting for non-string fields


(Hugh Williams) #1

I have a number of numeric, date, and boolean fields in my index. I'm
considering a mapping for them that specifies "index": "not_analyzed".

Is there any reason I'd want to analyze document fields that are supposed
to contain numerics, booleans, dates, etc?

--
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.


(Ivan Brusic) #2

The analysis settings have no relevance in non-text fields. If you look at
all the subclasses of AbstractFieldMapper, you will notice that only
StringFieldMapper, AFAIK, uses the analysis settings (besides the "no"
setting of course).

Cheers,

Ivan

On Wed, Oct 2, 2013 at 9:30 AM, Hugh Williams hughbiquitous@gmail.comwrote:

I have a number of numeric, date, and boolean fields in my index. I'm
considering a mapping for them that specifies "index": "not_analyzed".

Is there any reason I'd want to analyze document fields that are supposed
to contain numerics, booleans, dates, etc?

--
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.


(Hugh Williams) #3

Thanks Ivan. So is there any reason to specify "index":"not_analyzed" for
those field types?

On Wednesday, October 2, 2013 12:40:49 PM UTC-4, Ivan Brusic wrote:

The analysis settings have no relevance in non-text fields. If you look at
all the subclasses of AbstractFieldMapper, you will notice that only
StringFieldMapper, AFAIK, uses the analysis settings (besides the "no"
setting of course).

Cheers,

Ivan

On Wed, Oct 2, 2013 at 9:30 AM, Hugh Williams <hughbi...@gmail.com<javascript:>

wrote:

I have a number of numeric, date, and boolean fields in my index. I'm
considering a mapping for them that specifies "index": "not_analyzed".

Is there any reason I'd want to analyze document fields that are supposed
to contain numerics, booleans, dates, etc?

--
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.


(Ivan Brusic) #4

Correct, there is no reason to set the field as non_analyzed since it is
indexed and not tokenized by default.

As I was looking at the code myself, I noticed that the boolean field is
tokenized by default. I was about to submit an issue, but I noticed I has
been fixed already (I am on version 0.90.2).

Cheers,

Ivan.

On Wed, Oct 2, 2013 at 9:43 AM, Hugh Williams hughbiquitous@gmail.comwrote:

Thanks Ivan. So is there any reason to specify "index":"not_analyzed" for
those field types?

On Wednesday, October 2, 2013 12:40:49 PM UTC-4, Ivan Brusic wrote:

The analysis settings have no relevance in non-text fields. If you look
at all the subclasses of AbstractFieldMapper, you will notice that only
StringFieldMapper, AFAIK, uses the analysis settings (besides the "no"
setting of course).

Cheers,

Ivan

On Wed, Oct 2, 2013 at 9:30 AM, Hugh Williams hughbi...@gmail.comwrote:

I have a number of numeric, date, and boolean fields in my index. I'm
considering a mapping for them that specifies "index": "not_analyzed".

Is there any reason I'd want to analyze document fields that are
supposed to contain numerics, booleans, dates, etc?

--
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_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.


(Amit Soni) #5

Hi Ivan - A follow up question on this is how one should then search for
numbers: say if we search for 100.0 and 100, it should both yield same
result.

thoughts?

-Amit.

On Wed, Oct 2, 2013 at 10:50 AM, Ivan Brusic ivan@brusic.com wrote:

Correct, there is no reason to set the field as non_analyzed since it is
indexed and not tokenized by default.

As I was looking at the code myself, I noticed that the boolean field is
tokenized by default. I was about to submit an issue, but I noticed I has
been fixed already (I am on version 0.90.2).

Cheers,

Ivan.

On Wed, Oct 2, 2013 at 9:43 AM, Hugh Williams hughbiquitous@gmail.comwrote:

Thanks Ivan. So is there any reason to specify "index":"not_analyzed" for
those field types?

On Wednesday, October 2, 2013 12:40:49 PM UTC-4, Ivan Brusic wrote:

The analysis settings have no relevance in non-text fields. If you look
at all the subclasses of AbstractFieldMapper, you will notice that only
StringFieldMapper, AFAIK, uses the analysis settings (besides the "no"
setting of course).

Cheers,

Ivan

On Wed, Oct 2, 2013 at 9:30 AM, Hugh Williams hughbi...@gmail.comwrote:

I have a number of numeric, date, and boolean fields in my index. I'm
considering a mapping for them that specifies "index": "not_analyzed".

Is there any reason I'd want to analyze document fields that are
supposed to contain numerics, booleans, dates, etc?

--
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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BVp1uXrE%2Bgc4tv5xOG9ap06qXo0HXe4Bt7hnCn9wT48w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #6