Book Image

Sphinx Search Beginner's Guide

By : Abbas Ali
Book Image

Sphinx Search Beginner's Guide

By: Abbas Ali

Overview of this book

Table of Contents (15 chapters)
Sphinx Search
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Index attributes


Attributes in an index are used to perform additional filtering and sorting during search. They are basically additional values linked to each document in the index.

Let's try to understand the attributes using an example. Suppose you want to search through a catalog of books stored in the index. You want the results to be sorted by the date on which the book was published and then by the cost of the book. For this you need not put the date and cost of the book in the full-text index. You can specify these two values as attributes and then sort the results of you search query by these attributes. These attributes will play no role in searching but will play a major role in sorting the search results.

Note

Attributes play some role in relevancy when SPH_SORT _EXPR sort mode is used

Another use of attributes would be to filter the search results. You can filter your results for the specified date range so that only those books that were published in the given time period are...