This cube implements facets using postgresql text search vectors.
Project description
Summary
This cube implements facets using postgresql text search vectors.
What does this cube offer ?
This cube defines a new CubicWeb AppObject registry: tsfacets. The base class is cubicweb_tsfacets.views.TSFacets; it provides three methods allowing to recover information to use facets in a CubicWeb application:
get_facets_values_with_count, which recovers all available facets with how many target entities it filters for each value;
get_target_entities_count, which counts target entities taking into account the selected facets and possibly a RQL request to restrict results;
get_target_entities_rset, which builds a CubicWeb ResultSet taking into account the selected facets and possibly a RQL request to restrict results.
How to use it ?
For each group of facets, you have to define a child class of cubicweb_tsfacets.views.TSFacets. Then, you have to complete the following attributes:
key_names_to_rql_definition: a dictionary linking each facet key to a RQL query returning a list of tuples: (entity eid to retrieve if selecting this facet, value of the facet);
text_search_indexation: a RQL request returning a list of tuples: (target entity eid, text to index for full text search). This attribute is optional, and is only used if you want to add text search to your result list. Note: this feature will be added in an upcoming version;
target_etypes: which entity types are targeted by your facet search;
table_name: the name of the specific postgresql table.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cubicweb_tsfacets-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e40feae9c18626e4c797ceac40272f4676d746b7a3149690f39e38e87096acbd |
|
MD5 | 39f2c1238527610a22dbd4d0faacc086 |
|
BLAKE2b-256 | 691364a2105496a6526e772adf903a61db3a48661b19b4d4f7f6e66af12643da |