Skip to main content
Ctrl+K
Logo image

📕 Guides

  • Introduction to CubicWeb
    • 1. A little history

    • 2. The Core Concepts of CubicWeb
  • 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
    • Importing relational data into a CubicWeb instance
    • Create a data-oriented web application CubicWeb 4
      • Getting started
      • Developping the application
      • Developping the user interface
      • Enhance views
      • Data management with CubicWeb
  • Migrating to v4

⚙ 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
  • Backend Development
    • 1. Cubes
      • 1.1. What is a Cube?
      • 1.2. Standard structure for a cube
      • 1.4. Installing cubes
      • 1.5. Creating a new cube from scratch
      • 1.6. Available cubes
    • 2. The Registry, selectors and application objects
    • 3. Data model
      • 3.1. Yams schema
      • 3.4. Metadata
      • 3.5. Pre-defined entities in the library
      • 3.6. Defining a Workflow
    • 4. Data as objects
      • 4.1. Access to persistent data
      • 4.5. Loaded attributes and default sorting management
      • 4.6. Interfaces and Adapters
      • 4.7. How to use entities objects and adapters
    • 5. Core APIs
      • 5.1. Request and ResultSet methods
    • 6. Repository customization
      • 6.1. Sessions
      • 6.3. Hooks and Operations
      • 6.4. Notifications management
      • 6.5. Tasks
    • 7. Tests
    • 8. Migration
    • 9. Profiling and performance
    • 10. Full Text Indexing in CubicWeb
    • 11. Data Import
    • 12. Debug Channels
    • 14. Source connections pooler
  • 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
    • 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
    • cubicweb.appobject
    • cubicweb.cwvreg
    • cubicweb.dataimport
    • cubicweb.predicates
    • cubicweb.pyramid
      • cubicweb.pyramid.auth
      • cubicweb_web.bwcompat
      • cubicweb.pyramid.core
      • cubicweb.pyramid.login
      • cubicweb.pyramid.profile
      • cubicweb.pyramid.session
      • cubicweb.pyramid.url_redirection
    • cubicweb.req
    • cubicweb.rset
    • cubicweb_web.views.urlpublishing
    • cubicweb_web.views.urlrewrite
    • cubicweb_web
  • .rst

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.

class cubicweb_web.views.magicsearch.RQLSuggestionsBuilder(*args, **kwargs)[source]#

This component was previously used by the rql_suggest ajax function to provide completion to the search bar. It is now deprecated in favor of the cubicweb.rqlsuggestions.RQLSuggestionsBuilder class.

build_suggestions(user_rql)[source]#

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

Contents
  • How search is performed

© Copyright 2001-2024, Logilab.

Last updated on Mar 27, 2024.