Dev Docs
  • Disciple.Tools Technical Documentation
  • Theme Core
    • API - Posts
      • List of Endpoints
      • Fields Format
      • Get Post
      • Create Post
      • Update Post
      • Post Comments
      • Post Activity
      • List Query
      • Global Search
      • Posts in Typeaheads
      • Post-Sharing
      • Get Following
      • Settings
    • API - Other
      • Users
      • Locations
      • Settings
    • Hooks
      • Record Page Hooks
      • API-Hooks
      • Public settings
      • Adding menu navigation links
    • Customization
      • Fields
      • Custom Post Types
      • Post Type Modules
      • Adding Fields and Tiles.
    • Authentication
      • JWT-Authentication-for-the-mobile-app
      • Site-to-Site-Link
      • Easy-Example
    • Permissions
    • Roles and Permissions
    • Database Tables
      • Activity Table
    • Disciple.Tools Translation
    • Revisions
      • v1.0.0-dev-changes
      • v1.0
  • Hosting
    • 404 Errors on new install
    • CRON
    • Hosting on WPEngine
    • Backups
    • Single Site or MultiSite
  • Disciple.Tools Development Setup
    • LocalWP
    • Mobile App Setup
    • Unit Tests
    • Cypress Tests
    • D.T on Docker Setup
    • Gulp - CSS and JS
  • Code Contribution
    • Theme Contribution Guidelines
    • How to Correctly Contribute to the Disciple Tools Repository
    • How to Translate Your Plugin
  • Style Guide
  • Disciple.Tools Code of Conduct
Powered by GitBook
On this page
  • Advanced Search
  • Parameters
  • Returns

Was this helpful?

Edit on Git
  1. Theme Core
  2. API - Posts

Global Search

PreviousList QueryNextPosts in Typeaheads

Last updated 3 years ago

Was this helpful?

Advanced Search

Get

Parameters

  • query (string) mandatory. URI encoded search query.

  • post_type (string) mandatory. Post type name to be searched. Set to all for multiple post type searches.

  • offset (int) mandatory. How many initial search result hits to skip (for load more operations). Set to 0 as default.

Returns

{
   hits: (array) An array of result hits. See below for format.
   total_hits: (int) the number of result hits in total.
}

Result hits format:

[
  {
    "post_type":"contacts",
    "posts":[
      "ID": "56",
      "post_title": "Ali XYZ",
      "post_type": "contacts",
      "post_date": "2018-05-29 14:19:36",
      "post_hit": "N", //post hit type indicator (Y/N)
      "comment_hit": "Y", //comment hit type indicator (Y/N)
      "meta_hit": "N", //meta hit type indicator (Y/N)
      "comment_hit_content": "Wow! He is willing to meet today!",
      "meta_hit_value": ""
    ],
    "total": 1,
    "offset": 2 //current offset value for result post type
  },
  {
    ...hit2...
  }
]
https://example.com/wp-json/dt-posts/v2/posts/search/advanced_search