Skip to content

Field Naming Guidelines

dbuthay edited this page Jun 2, 2011 · 2 revisions

What's this ?

indextank-jquery assumes certain things about documents in your indexes. It will generate queries and render results based on those assumptions.

You can override those assumptions, but you'd probably want to stick with the defaults. This guideline explains those defaults, so you can generate an index that will work with Indextank-jquery out-of-the-box.

So, conventions

Each document should have

  • name
  • url
  • text

And optionally

  • description
  • thumbnail

Which plugins use this conventions ?

Plugins doing rendering, and searching. At this time, AjaxSearch, Renderer and InstantLinks will use them.

What do they use them for ?

AjaxSearch

  • it queries the text field of the document. You can override it by setting a rewriteQuery function, to query a different field.
  • fetches the list of fields above. You can override it by setting the fields option

Renderer

  • it renders results, each having
    • name, with a link to url
    • a snippet of text
    • an optional thumbnail

InstantLinks

  • it queries the name field, to retrieve results.
  • it renders results, each having
    • name
    • url (and follows the link upon selection)
    • an optional description
    • an optional thumbnail

Clone this wiki locally