Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
explicitly define double type for revenue in mkt's elasticsearch mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Jul 20, 2012
1 parent cfc50e5 commit 67f7629
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mkt/stats/search.py
Expand Up @@ -182,19 +182,19 @@ def setup_mkt_indexes():
'date': {'format': 'dateOptionalTime',
'type': 'date'},
'count': {'type': 'long'},
'revenue': {'type': 'double'},

# Try to tell ES not to 'analyze' the field to querying with
# hyphens and lowercase letters.
'currency': {'type': 'string',
'index': 'not_analyzed'},
'source': {'type': 'string',
'index': 'not_analyzed'},
'inapp': {'type': 'string',
'index': 'not_analyzed'}
}
}

# Try to tell ES not to 'analyze' the field to querying with hyphens
# and lowercase letters.
if model == Contribution or model == InappPayment:
mapping['properties']['currency'] = {'type': 'string',
'index': 'not_analyzed'}
mapping['properties']['source'] = {'type': 'string',
'index': 'not_analyzed'}
mapping['properties']['inapp'] = {'type': 'string',
'index': 'not_analyzed'}

es.put_mapping(model._meta.db_table, mapping,
model._get_index())

Expand Down

0 comments on commit 67f7629

Please sign in to comment.