Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools



Sphinx Structure

Sphinx Basics § Thinking Sphinx

A Sphinx daemon (the process known as searchd) can talk to a collection of indexes. Each index tracks a set of documents, and each document is made up of fields and attributes. While in other areas of software you could use those two terms interchangeably, they have distinctly different meanings in Sphinx.


Fields are the content for your search queries – so if you want words tied to a specific document, you better make sure they’re in a field in your index. They are only string data – you could have numbers and dates and such in your fields, but Sphinx will only treat them as strings, nothing else.


Attributes are used for sorting, filtering and grouping your search results. Their values do not get paid any attention by Sphinx for search terms, though, and they’re limited to the following data types: integers, floats, datetimes (as Unix timestamps – and thus integers anyway), booleans, and strings. Take note that string attributes cannot be used in filters, but only for sorting and grouping.

Multi-Value Attributes

There is also support in Sphinx to handle arrays of attributes for a single document – which go by the name of multi-value attributes. Currently, only integers, big integers (64 bit) and timestamps are supported, so this isn’t quite as flexible as normal attributes, but it’s worth keeping in mind.


it/sphinx.txt · Last modified: 2013/11/11 15:01 by admin