Search
GET search?q=&lang=&offset=&limit= searches the published entries with an address that are not noindex.
What it gives
total,offset,limitanditems.limitis 10 by default, and at most 50. The items come best first. Each item hastitle,url(a path),snippet,type,date,image,id,module,markdown_urlandrelevance. Thesnippetis plain text with whole words, and…where it is cut. Thetypeispage,blogorrecord.facets.moduleis[{value, label, count}]. It is counted beforemodule=filters.module=blog,pageonly keeps those kinds.- Each item has
score,foundandterms.foundare the words that were found, andtermsis how many words were asked for.ai=1adds theai_contextof each item. No AI is asked. screensis given per item, when the page has them. These are the admin screens that a help article is about, such as["/content/#blog"]. They come fromadmin:in its front matter, and are kept on import from a zip.
For one screen of the admin
screen=/content/#blog is for the help of Lightbolt itself, for About this page. It puts first the pages about exactly that screen and tab. Then it puts the pages about the same screen. Then the rest. Each group keeps its own order. Without q, it only gives the pages about that screen. A frontend that searches its own copy does the same, with the screens of each entry. Those are in GET entries, per language.
The order
Every site orders results by one score. It is set under Site settings → Search, and sent as settings.search in GET site. A frontend that searches its own copy uses the same rules on the same fields. So the order is the same on both sides.
- The fields are the title,
ai.context, the focus words (seo.keywords),seo.description, andsearch.text.search.textis the plain text, sent ready to use. - The words are made without accents (NFKD), and in lowercase. They are words of 2 characters or more, and at most 6 of them. A word counts fully when it is whole. It counts as
prefix(0.5) when a longer word starts with it, from 3 characters. Words of 2 characters are never needed. - The score uses a weight per field. The text counts less with each extra hit, up to
text_cap. There is a bonus when the title holds the words in a row, and a factor per kind. Newer items can also count higher. - Which first is
all_firstby default. That puts pages with every needed word first, and then those with some. There are alsoallandany.
settings.search.engine says who answers. With score, you search your own copy. With elasticsearch, you ask GET search and keep its order. The kind of an item is the module key of a record, blog, or page for everything else. The exact rules are in FRONTEND.md, under Search score, with cases in lib/data/search-fixtures.json. With Elasticsearch, the CMS keeps the order of Elasticsearch.
Good to know
itemsis empty when the site has search off.GET searchcounts nothing. What visitors search for comes from the frontend. That shows under Insights → What to improve. The frontend sends its finished searches and clicks in POST reports, assearches. These are anonymous counts per term and per day, without an IP, a session or a time.- A site can have its search answered by Elasticsearch. The answer has the same shape, and also finds typos.
- The public search endpoint for AI agents is on the site itself. See AI and agents.
Also called: search API, full-text search, site search.
Last changed