lugensa / scorched

Sunburnt offspring solr client
MIT License
27 stars 19 forks source link

Dot in the field name and query composition #29

Closed Guibod closed 8 years ago

Guibod commented 8 years ago

My issue is fairly simple, my index contains fields that have dots (.) in it, for instance: object.id

I try to create a range query :

search.query(object.id__lt=before)

But that's not a legal way to declare field.

What I have found yet is to add a LuceneQuery manually:

search.query_obj.add_range('object.id', 'lt', before)

Is there a better way to bypass that problem ?

Guibod commented 8 years ago

For who cares, and since I learned a little bit of Python since my last issue, you can bypass this limitation this way:

q={"object.id__lt":before}
search.query(**q)

I close the subject at it is not a scorched issue.