• GitHub
  • Discuss
  • Twitter
  • Getting Started
    • Introduction
    • Installation
    • Documentation
    • Tutorial
    • Guides
  • Basics
    • What is Frappe?
    • Why Frappe?
    • Architecture
    • Directory Structure
    • Apps
    • Sites
    • DocTypes
    • Users and Permission
  • Desk (Admin UI)
    • Desk
    • Reports
    • Printing
    • Scripting
    • Translations
  • Portal
    • Portal Pages
    • Web Forms
  • Python API
    • Document
    • Database
    • Jinja
    • Router
    • Response
    • Search
    • Hooks
    • REST API
    • Full Text Search
    • Dialog API
  • Javascript API
    • Form
    • Controls
    • Page
    • Common Utilities
    • Dialog API
  • Integrations
    • Razorpay
  • Bench CLI
    • What is Bench?
    • Bench Commands
    • Frappe Commands
    • Extending the CLI
  • Deployment
    • Database Migrations
    • Production Setup
    • Rate Limiting
  • Writing Tests
    • Server Side Tests
    • UI Tests
  • Help
    • Debugging
    • Contribution Guidelines
  • Getting Started
    • Introduction
    • Installation
    • Documentation
    • Tutorial
    • Guides
  • Basics
    • What is Frappe?
    • Why Frappe?
    • Architecture
    • Directory Structure
    • Apps
    • Sites
    • DocTypes
    • Users and Permission
  • Desk (Admin UI)
    • Desk
    • Reports
    • Printing
    • Scripting
    • Translations
  • Portal
    • Portal Pages
    • Web Forms
  • Python API
    • Document
    • Database
    • Jinja
    • Router
    • Response
    • Search
    • Hooks
    • REST API
    • Full Text Search
    • Dialog API
  • Javascript API
    • Form
    • Controls
    • Page
    • Common Utilities
    • Dialog API
  • Integrations
    • Razorpay
  • Bench CLI
    • What is Bench?
    • Bench Commands
    • Frappe Commands
    • Extending the CLI
  • Deployment
    • Database Migrations
    • Production Setup
    • Rate Limiting
  • Writing Tests
    • Server Side Tests
    • UI Tests
  • Help
    • Debugging
    • Contribution Guidelines

FullTextSearch API Reference

Frappe Wrapper for Whoosh

update_index_by_name(self, doc_name)

Wraps update_index method, gets the document from name and updates the index. This function changes the current user and should only be run as administrator or in a background job.

Args:

  • self (object): FullTextSearch Instance
  • doc_name (str): name of the document to be updated

remove_document_from_index(self, doc_name)

Remove document from search index

Args:

  • self (object): FullTextSearch Instance
  • doc_name (str): name of the document to be removed

update_index(self, document)

Update search index for a document

Args:

  • self (object): FullTextSearch Instance
  • document (_dict): A dictionary with title, path and content

build_index(self)

Build index for all parsed documents

search(self, text, scope=None, limit=20)

Search from the current index

Args:

  • text (str): String to search for
  • scope (str, optional): Scope to limit the search. Defaults to None.
  • limit (int, optional): Limit number of search results. Defaults to 20.

Returns:

  • [list(_dict)]: Search results
On this page
  • FullTextSearch API Reference
    • update_index_by_name(self, doc_name)
    • remove_document_from_index(self, doc_name)
    • update_index(self, document)
    • build_index(self)
    • search(self, text, scope=None, limit=20)
Footer Logo
Getting Started
  • Introduction
  • Installation
  • Tutorial
  • Guides
Basics
  • What is Frappe?
  • Architecture
  • Apps
  • Sites
  • User Permissions
Admin UI
  • Desk
  • Reports
  • Printing
  • Scripting
  • Translations
Deployment
  • Bench
  • Production Setup
  • Migrations
  • Rate Limiting
Forum Frappe Docs GitHub
© Frappe. Content licensed under CC-BY-SA 3.0.
+91 22 4897 0555 - hello@frappe.io

Built on Frappe