logo

Tutorials

  • Tutorials
    • Building a simple blog with CubicWeb
      • Get a blog running in five minutes!
      • Discovering the web interface
      • Customizing your application
      • What’s next?
    • Building a photo gallery with CubicWeb
      • 1. Cube creation and schema definition
      • 2. Security, testing and migration
      • 3. Storing images on the file-system
      • 4. Let’s make it more user friendly
      • 5. Building my photos web site with CubicWeb part V: let’s make it even more user friendly
    • Use Windmill with CubicWeb
    • Writing text reports with RestructuredText
    • Importing relational data into a CubicWeb instance
    • Create a Website from scratch with CubicWeb
      • Getting started
      • Enhance views
      • Data management with CubicWeb

⚙ Setup and Usage

  • Setup and Administration
    • 1. Install a CubicWeb environment
    • 2. Configure a CubicWeb environment
    • 3. Deploy a CubicWeb application
    • 4. cubicweb-ctl tool
    • 5. Creation of your first instance
    • 6. Configure an instance
    • 7. User interface for web site configuration
    • 8. Multiple sources of data
    • 9. LDAP integration
    • 10. RQL logs
  • Web Frontend Development
    • Publisher
    • Controllers
    • The Request class ( cubicweb.web.request )
    • RQL search bar
    • The View system
      • Principles
      • Templates
      • The Primary View
      • The “Click and Edit” (also reledit ) View
      • Base views
      • Startup views
      • Boxes
      • Table views
      • XML and RSS views
      • URL publishing
      • Breadcrumbs
      • The ‘download’ views
      • Online documentation system
    • Configuring the user interface
    • Ajax
    • Javascript
      • Javascript API
    • CSS Stylesheet
    • Edition control
      • HTML form construction
      • Dissection of an entity form
      • The edit controller
      • Examples
    • The facets system
    • Internationalization
    • The property mecanism
    • HTTP cache management
    • Locate resources
  • Pyramid
    • Quick start
    • The ‘pyramid’ command
    • Settings
    • Authentication
    • The pyramid debug toolbar
  • Additional Services
    • Undoing changes in CubicWeb

➕ More

  • Appendixes
    • 1. Frequently Asked Questions (FAQ)
    • 2. Relation Query Language (RQL)
      • 2.1. Introduction
      • 2.2. RQL syntax
      • 2.3. Debugging RQL
      • 2.4. RQL usecases
      • 2.5. Implementation
    • 3. Introducing Mercurial
    • 4. Installation dependencies
    • 5. Javascript docstrings
  • Changelog
  • API
    • cubicweb_web
    • cubicweb.dataimport
    • cubicweb_web.predicates
    • cubicweb.pyramid
      • cubicweb.pyramid.auth
      • cubicweb.pyramid.bwcompat
      • cubicweb.pyramid.core
      • cubicweb.pyramid.defaults
      • cubicweb.pyramid.login
      • cubicweb.pyramid.profile
      • cubicweb.pyramid.session
      • cubicweb.pyramid.url_redirection
    • cubicweb.web.views.urlrewrite
Theme by the Executable Book Project
  • .rst
Contents
  • How search is performed

RQL search bar

Contents

  • How search is performed

RQL search bar#

The RQL search bar is a visual component, hidden by default, the tiny search input being enough for common use cases.

An autocompletion helper is provided to help you type valid queries, both in terms of syntax and in terms of schema validity.

How search is performed#

You can use the rql search bar to either type RQL queries, plain text queries or standard shortcuts such as <EntityType> or <EntityType> <attrname> <value>.

Ultimately, all queries are translated to rql since it’s the only language understood on the server (data) side. To transform the user query into RQL, CubicWeb uses the so-called magicsearch component, defined in cubicweb.web.views.magicsearch, which in turn delegates to a number of query preprocessor that are responsible of interpreting the user query and generating corresponding RQL.

The code of the main processor loop is easy to understand:

for proc in self.processors:
    try:
        return proc.process_query(uquery, req)
    except (RQLSyntaxError, BadRQLQuery):
        pass

The idea is simple: for each query processor, try to translate the query. If it fails, try with the next processor, if it succeeds, we’re done and the RQL query will be executed.

previous

The Request class (cubicweb.web.request)

next

The View system

© Copyright 2022-2023, Logilab.
Last updated on Mar 28, 2023.