Hi,
I'm trying to implement a search on a subset of the geonames database. I would like matching countries to come above other matches -
All places have an 'fcode' feature code. For a country this is 'PCLI' -
When I do something like this:
sqs = SearchQuerySet().autocomplete(content_auto=q).boost('PCLI',1.1)
I only get country results.
content_auto is something like 'London, United Kingdom' or 'United Kingdom'
So if I search for 'United Kingdom' i get a lot of places within the UK before I get 'United Kingdom'
My index looks like this:
text = indexes.CharField(document=True, use_template=True)
name = indexes.CharField(model_attr='formatted_name')
alternates = indexes.CharField(model_attr='alternates')
moddate = indexes.DateTimeField(model_attr='moddate')
content_auto = indexes.EdgeNgramField(use_template=True)
where content_auto is {{
object.name }}, {{ object.country }}
Any ideas how to implement this?
Thanks,
Guy