You can continue indexing as you are doing now:
fields = [
TextField(name="name", value=proj.value),
TextField(name="statement", value=proj.statement)
HtmlField(name="description", value=proj.description)
]
NOTE: You may want to strip the html before indexing it, unless it really adds value to have it as such
And then use the value as query. If you don't specify a field, you'll get results for documents with matches in any field.
your_index.search(query) # This will match the value of city in any field
If you have more fields that the ones you are saying here, and don't want those included in your search, then using a field to specify the combined values of those 3 would be the way to go:
fields = [
TextField(name="name", value=proj.value),
TextField(name="statement", value=proj.statement)
HtmlField(name="description", value=proj.description)
TextField(name="foo", value=proj.foo)
TextField(name="bar", value=proj.bar)
TextField(name="composed_field", value=' '.join((
proj.value,
proj.statement,
proj.description
)) # or something like this
]
And then:
your_index.search('composed_field:"%s"' % query) # Look ma', no OR