There are a few options within the search api:

Scale/truncate the double to fit - this fails if your double has a wide range 
(such as very large and very small values across the dataset)

Store in multiple fields and create a query that knows how to span them (ie 
store the low and high quantities separately, such as everything before the 
decimal point in one value, shifted down appropriately and everything after the 
decimal point shifted up).

Stringify the double and store as a string, note that comparisons and ordering 
will be alphabetical so you'll need to zero pad the start and end, negative 
numbers would also be an issue.


Outside of that, you'll probably need to find another way, such as cloudsql, 
the datastore or another external search index (like elastic search on GCE)

As an aside, the search index is not very good with numbers. As you've learnt, 
it actually has the range of an int, with the precision of a float passed in as 
a double (wtf?).
It also behaves oddly when doing granular range queries. For example, if you do 
a query where x <= 0.21, it can in practice return values larger than this, 
such as 0.22. This seems to be related to how it writes the index, grouping 
indexed values into 'batches'. 

There's also a faceted search api in trusted tester I think, this might be the 
thing for you.

It would be interesting to hear what you actually choose in the end.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/ee26dbab-25f3-4855-9468-d9769ccba534%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to