sphinx-searchHow to use sql_attr_timestamp in SphinxSearch?
SphinxSearch provides the sql_attr_timestamp
directive to index and query timestamp fields. This directive allows Sphinx to convert a timestamp field into a UNIX timestamp, which can then be used for sorting and filtering.
Example code
index test
{
source = test_source
sql_attr_timestamp = timestamp_field
}
This example code will index the timestamp_field
from the test_source
source.
Code explanation
index test
: This defines the index name.source = test_source
: This defines the source from which the data will be indexed.sql_attr_timestamp = timestamp_field
: This directive tells Sphinx to convert thetimestamp_field
from thetest_source
source into a UNIX timestamp.
Helpful links
More of Sphinx Search
- How to order search results by relevance in SphinxSearch?
- How to specify stop words in SphinxSearch?
- How to use the MySQL protocol in SphinxSearch?
- How to get the version of SphinxSearch?
- How to use SphinxSearch with PHP?
- How to use regexp_filter in SphinxSearch?
- How to use query_log_format in SphinxSearch?
- How to configure max_children in SphinxSearch?
- How to use forward slash in SphinxSearch?
- How to use sql_attr_float in SphinxSearch?
See more codes...