> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: documents() # Method package: wixSearch # Method menu location: wixSearch --> WixSearchResult --> documents # Method Link: https://dev.wix.com/docs/velo/apis/wix-search/wix-search-result/documents.md # Method Description: Returns the documents that match the search. The current page of documents retrieved by the search. The properties included in the search result `documents` array depend on the [`documentType`](wix-search.WixSearchBuilder.html#documentType) specified for the search. If the `documentType` is set to `Site/Pages`, only the default `document` properties listed below are returned. If the `documentType` is set to a specific Wix app collection (such as `"Stores/Products"`), the returned search result `documents` contain additional fields. The fields included in the returned `documents` are different for each `documentType`. To view the search schema for each document type, see the following articles: - [Blog/Posts schema](https://support.wix.com/en/article/corvid-wix-blog-schema-for-wix-search) - [Bookings/Services schema](https://support.wix.com/en/article/corvid-wix-bookings-schema-for-wix-search) - [Forum/Content schema](https://support.wix.com/en/article/corvid-wix-forum-schema-for-wix-search) - [Stores/Products schema](https://support.wix.com/en/article/corvid-wix-stores-schema-for-wix-search) The search result page size is defined by the [`limit()`](https://dev.wix.com/docs/velo/api-reference/wix-search/wix-search-builder/limit.md) function, can be retrieved using the [`pageSize`](#pageSize) property, and navigating through pages is done with the [`prev()`](#prev) and [`next()`](#next) functions. When no documents match the search, the `documents` array is empty. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get the documents of a search result ```javascript let documents = results.documents; /** * [ * { * "_id": "msr9v", * "url": "/about", * "documentType" "Site/Pages", * "image": "wix:image://v1/45...bba2~mv2.jpg#originWidth=750&originHeight=750", * "title": "The Leader in Website Creation", * "description": "Create your own professional web presence—exactly the way you want. Our powerful..." * }, * ... * ] */ ``` ## Perform a search and get the documents of the result ```javascript import wixSearch from 'wix-search'; // ... $w("#searchInput").onKeyPress((keyPress) => { if (keyPress.key === "Enter") { const phrase = $w("#searchInput").value; wixSearch.search(phrase) .find() .then((results) => { if (results.documents.length > 0) { let documents = results.documents; } else { console.log("No matching results"); } }) .catch((error) => { console.log(error); }); } }); /** * [ * { * "_id": "aqmg7", * "url": "/about", * "documentType" "Site/Pages", * "image": "wix:image://v1/45...bba2~mv2.jpg#originWidth=750&originHeight=750", * "title": "Page title", * "description": "Page text" * }, * { * "_id": "mzwrn", * "url": "/shop", * "documentType" "Site/Pages", * "image": "wix:image://v1/20...8hui~mv2.jpg#originWidth=250&originHeight=250", * "title": "Shop | My Site Name", * "description": "My first product description" * }, * { * "_id": "k4ytu", * "url": "/book-online", * "documentType" "Site/Pages", * "image": "wix:image://v1/11..._s_2.jpg#originWidth=3534&originHeight=2366", * "title": "Book Online | My Site Name", * "description": "My first service description" * }, * ... * ] */ ``` ## Perform a search on blog posts and get the documents of the search result ```javascript import wixSearch from 'wix-search'; // ... $w("#searchInput").onKeyPress((keyPress) => { if (keyPress.key === "Enter") { const phrase = $w("#searchInput").value; wixSearch.search(phrase) .documentType("Blog/Posts") .find() .then((results) => { if (results.documents.length > 0) { let documents = results.documents; } else { console.log("No matching results"); } }) .catch((error) => { console.log(error); }); } }); /** * [ * { * "_id": "5df745e85db76a0017862a59", * "url": "/post/manage-your-blog-from-your-live-site", * "documentType" "Blog/Posts", * "image": "wix:image://v1/20...8hui~mv2.jpg#originWidth=250&originHeight=250", * "title": "Now You Can Blog from Everywhere!", * "description": "We’ve made it quick and convenient for you to..." * "hashtags": ["bloggingtips", "wixblog"] * }, * { * "_id": "5df745e85db76a0017862a61", * "url": "/post/grow-your-blog-community", * "documentType" "Blog/Posts", * "image": "wix:image://v1/73...tg6i.jpg#originWidth=750&originHeight=750", * "title": "Grow Your Blog Community", * "description": "With Wix Blog, you’re not only sharing your voice...", * "hashtags": ["bloggingtips", "wixblog", "yourvoice"] * }, * { * "_id": "5df745e85db76a0017862a64", * "url": "/post/design-a-stunning-blog", * "documentType" "Blog/Posts", * "image": "wix:image://v1/11..._s_2.jpg#originWidth=3534&originHeight=2366", * "title": "Design a Stunning Blog", * "description": "When it comes to design, the Wix blog has..." * "hashtags": "["wixblog", "stunning"]" * } * ] */ ``` ---