rtfd/readthedocs.org — pull request #189 by Nagyman (2012-03-16 01:24:18+00:00)
Title: Search api & instant search

I started work on the api to add facets and pagination information to make it easier to support all of those features with the "instant search", but it will require bunch of additional javascript development. The API has been augmented with that information for that future dev. (example below)

In the meantime, I've just changed the instant search to grab the html fragment from the standard view (no api involved). This at least keeps pagination and facets working fully with the instant search feature.

==== Example API Additions
/api/v1/file/search/?q=django&format=json

```json
{
facets: {
dates: { },
fields: {
project: [
["Haystack", 12],
]
},
queries: { }
},
objects: [...],
page: {
num_pages: 4,
number: 1,
object_count: 61,
page_range: [1, 2, 3, 4],
per_page: 20,
url_next: "/api/v1/file/search/?q=django&format=json&page=2",
url_template: "/api/v1/file/search/?q=django&format=json&page={0}"
}
}
```