X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/9b97d5a2faa6f56b439dcefe9c7bb23e0a84b39c..db833ba4517084f61a64907c6d15606e7c881edd:/apps/djangosphinx/templates/source.conf diff --git a/apps/djangosphinx/templates/source.conf b/apps/djangosphinx/templates/source.conf new file mode 100644 index 000000000..a991f6415 --- /dev/null +++ b/apps/djangosphinx/templates/source.conf @@ -0,0 +1,31 @@ +source {{ source_name }} +{ + type = {{ database_engine }} + strip_html = 0 + index_html_attrs = + sql_host = {{ database_host }} + sql_user = {{ database_user }} + sql_pass = {{ database_password }} + sql_db = {{ database_name }} + sql_port = {{ database_port }} + log = {{ log_file }} + + sql_query_pre = + sql_query_post = + sql_query = \ + SELECT {{ field_names|join:", " }} \ + FROM {{ table_name }} + sql_query_info = SELECT * FROM `{{ table_name }}` WHERE `{{ primary_key }}` = $id +{% if group_columns %} + # ForeignKey's +{% for field_name in group_columns %} sql_group_column = {{ field_name }} +{% endfor %}{% endif %} +{% if bool_columns %} + # BooleanField's +{% for field_name in bool_columns %} sql_group_column = {{ field_name }} +{% endfor %}{% endif %} +{% if date_columns %} + # DateField's and DateTimeField's +{% for field_name in date_columns %} sql_date_column = {{ field_name }} +{% endfor %}{% endif %} +} \ No newline at end of file