RE: benefits of float vs. string

2010-04-30 Thread Nagelberg, Kallin
When using numerical types you can do ranges like 3 < myfield <= 10 , as well 
as a lot of other interesting mathematical functions that would not be possible 
with a string type.

Thanks for the info Yonik,
-Kallin Nagelberg

-Original Message-
From: Dennis Gearon [mailto:gear...@sbcglobal.net] 
Sent: Friday, April 30, 2010 1:27 AM
To: solr-user@lucene.apache.org; yo...@lucidimagination.com
Subject: Re: benefits of float vs. string

Please explain a range query? 

tia :-)

Dennis Gearon

Signature Warning

EARTH has a Right To Life,
  otherwise we all die.

Read 'Hot, Flat, and Crowded'
Laugh at http://www.yert.com/film.php


--- On Thu, 4/29/10, Yonik Seeley  wrote:

> From: Yonik Seeley 
> Subject: Re: benefits of float vs. string
> To: solr-user@lucene.apache.org
> Date: Thursday, April 29, 2010, 1:01 PM
> On Wed, Apr 28, 2010 at 11:22 AM,
> Nagelberg, Kallin
> 
> wrote:
> > Does anyone have an idea about the performance
> benefits of searching across floats compared to strings? I
> have one multi-valued field that contains about 3000
> distinct IDs across 5 million documents. I am going to be a
> lot of queries like q=id:102 OR id:303 OR id:305, etc. Right
> now it is a String but I am going to switch to a float as
> intuitively it ought to be easier to filter a number than a
> string.
> 
> 
> There won't be any difference in search speed for term
> queries as you
> show above.
> If you don't need to do sorting or range queries on that
> field, I'd
> leave it as a String.
> 
> 
> -Yonik
> Apache Lucene Eurocon 2010
> 18-21 May 2010 | Prague
> 


Re: benefits of float vs. string

2010-04-29 Thread Dennis Gearon
Please explain a range query? 

tia :-)

Dennis Gearon

Signature Warning

EARTH has a Right To Life,
  otherwise we all die.

Read 'Hot, Flat, and Crowded'
Laugh at http://www.yert.com/film.php


--- On Thu, 4/29/10, Yonik Seeley  wrote:

> From: Yonik Seeley 
> Subject: Re: benefits of float vs. string
> To: solr-user@lucene.apache.org
> Date: Thursday, April 29, 2010, 1:01 PM
> On Wed, Apr 28, 2010 at 11:22 AM,
> Nagelberg, Kallin
> 
> wrote:
> > Does anyone have an idea about the performance
> benefits of searching across floats compared to strings? I
> have one multi-valued field that contains about 3000
> distinct IDs across 5 million documents. I am going to be a
> lot of queries like q=id:102 OR id:303 OR id:305, etc. Right
> now it is a String but I am going to switch to a float as
> intuitively it ought to be easier to filter a number than a
> string.
> 
> 
> There won't be any difference in search speed for term
> queries as you
> show above.
> If you don't need to do sorting or range queries on that
> field, I'd
> leave it as a String.
> 
> 
> -Yonik
> Apache Lucene Eurocon 2010
> 18-21 May 2010 | Prague
> 


Re: benefits of float vs. string

2010-04-29 Thread Yonik Seeley
On Wed, Apr 28, 2010 at 11:22 AM, Nagelberg, Kallin
 wrote:
> Does anyone have an idea about the performance benefits of searching across 
> floats compared to strings? I have one multi-valued field that contains about 
> 3000 distinct IDs across 5 million documents. I am going to be a lot of 
> queries like q=id:102 OR id:303 OR id:305, etc. Right now it is a String but 
> I am going to switch to a float as intuitively it ought to be easier to 
> filter a number than a string.


There won't be any difference in search speed for term queries as you
show above.
If you don't need to do sorting or range queries on that field, I'd
leave it as a String.


-Yonik
Apache Lucene Eurocon 2010
18-21 May 2010 | Prague


Re: benefits of float vs. string

2010-04-29 Thread Lance Norskog
Floats are Trie types and are stored in a compressed format. They will
search faster. They will also sort with much less space.

One thing to point out is that doing bitwise comparison on floats is
to live in a state of sin. Your string representations must parse
exactly right.

On Wed, Apr 28, 2010 at 8:22 AM, Nagelberg, Kallin
 wrote:
> Hi,
>
> Does anyone have an idea about the performance benefits of searching across 
> floats compared to strings? I have one multi-valued field that contains about 
> 3000 distinct IDs across 5 million documents. I am going to be a lot of 
> queries like q=id:102 OR id:303 OR id:305, etc. Right now it is a String but 
> I am going to switch to a float as intuitively it ought to be easier to 
> filter a number than a string. I'm just curious if this should in fact bring 
> a benefit, and more generally what the benefits/penalties to using numerical 
> over string field types is.
>
> Thanks,
> Kallin Nagelberg
>



-- 
Lance Norskog
goks...@gmail.com


benefits of float vs. string

2010-04-28 Thread Nagelberg, Kallin
Hi,

Does anyone have an idea about the performance benefits of searching across 
floats compared to strings? I have one multi-valued field that contains about 
3000 distinct IDs across 5 million documents. I am going to be a lot of queries 
like q=id:102 OR id:303 OR id:305, etc. Right now it is a String but I am going 
to switch to a float as intuitively it ought to be easier to filter a number 
than a string. I'm just curious if this should in fact bring a benefit, and 
more generally what the benefits/penalties to using numerical over string field 
types is.

Thanks,
Kallin Nagelberg