liveBook · Manning

Information retrieval

As explained in Build a Website with ChatGPT

Search is the process of finding records whose data matches a user-supplied word or phrase.

Information retrieval means finding records whose data matches a word or phrase supplied by a user. On a web page, the user enters search text, and the displayed data is replaced with matching records. section 13.4.1

A search component is usually a text box. Give it an ID so JavaScript can identify it, and use a placeholder to tell users what to enter. JavaScript monitors the field and refreshes the displayed JSON records as the user types. section 13.4.1

Search a course catalog

Add a text box with the ID "Search" and placeholder "Search". Prompt JavaScript to repopulate the article element with records containing the typed text in any field. To narrow the search, exclude selected fields or name only the fields to search. section 13.4.1 section 13.5

A text box with the ID "Search" and the placeholder "Search".

Use the search-box listing as a compact HTML starting point. section 13.4.1

When the user types text in the "Search" text box, 
repopulate the article element with just the records 
that include the search text in any field.

Use the behavior listing as a copyable JavaScript requirement. section 13.4.1

How Build a Website with ChatGPT covers it

How deep it goes
Explains the text-box workflow and field selection, but defers the generated JavaScript implementation details.
Examples
Uses a course catalog, a Search text box, an article element, and JSON records as concrete artifacts.
What it assumes
Assumes JSON data and a web page structure, while supplying beginner-friendly prompts for the search interface and behavior.
What you can do after
Build it from scratch by prompting for HTML and JavaScript that search JSON records while typing.
How it connects
Connects searching with JSON, JavaScript, HTML, filtering, and sorting.

Also explained in

Compare how 11 books explain information retrieval →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.