Explorador de datos de Discourse

:discourse2: Resumen Discourse Data Explorer te permite realizar consultas SQL contra tu base de datos en vivo, lo que permite informes de estadísticas actualizados al minuto.
:open_book: Guía de instalación Este plugin viene incluido con el núcleo de Discourse. No es necesario instalar el plugin por separado.

:information_source: Si buscas ejemplos o soporte para consultas personalizadas, puedes encontrar muchos temas en nuestra categoría #data-reporting bajo la etiqueta sql-query. Si no hay uno que se adapte a tus necesidades particulares, siéntete libre de crear un nuevo tema para pedir ayuda a la comunidad. :memo: Ayuda con consultas

:discourse2: ¿Alojado por nosotros? Este plugin está disponible en nuestros planes Business y Enterprise. Data Explorer | Discourse - Civilized Discussion

Después de instalar el plugin, ve a /admin/plugins.

de1

Haz clic en el botón «Configuración» y activa data explorer enabled, luego regresa y recarga la página.
Ahora debería haber una pestaña en la navegación apilada llamada «Data Explorer». Selecciónala o ve a /admin/plugins/discourse-data-explorer, luego usa los botones +, Importar o Ejecutar para empezar.

Consultas predeterminadas

En una instalación nueva, el Data Explorer ahora incluye varias consultas que pueden ayudarte a obtener información sobre la actividad de tu foro. Abre cualquier consulta y haz clic en Ejecutar para probarla.

Así es como se ven las consultas estándar.

Nota: Las consultas predeterminadas se obtienen de este archivo: discourse-data-explorer/lib/discourse_data_explorer/queries.rb at main · discourse/discourse-data-explorer · GitHub

Si tienes una consulta increíble que quieres que todos tengan, haz una PR como esta.

Las consultas predeterminadas no se pueden editar; si deseas modificarlas, siéntete libre de copiar el SQL y pegarlo en una nueva consulta.

Escribiendo consultas

Cuando haces clic en cualquiera de los botones Editar en una vista de consulta o inicias una nueva consulta de explorador, se te presenta una pantalla como la siguiente:

Los dos cuadros superiores son el nombre y la descripción de la consulta. El nombre es lo que seleccionas en el cuadro desplegable, y la descripción debe usarse para cosas como explicar qué poner en los parámetros de la consulta o describir qué datos se están consultando.

El panel izquierdo es donde escribes la consulta SQL. Se proporciona resaltado de sintaxis y verificación menores.

Ejecución automática de consultas

Aunque siempre puedes ejecutar una consulta haciendo clic en el botón Ejecutar, puedes ahorrar tiempo al cargar una consulta agregando el parámetro run a la URL.

Por ejemplo: /admin/plugins/discourse-data-explorer/queries/123?run

Cuando se agrega este parámetro a la URL, la consulta se ejecuta tan pronto como cargas la página, por lo que no necesitas hacer clic en el botón Ejecutar para ver los resultados. Esto es especialmente útil para consultas que ejecutas con frecuencia, permitiéndote marcarlas como favoritas o agregarlas a tu barra lateral con el parámetro run incluido para un informe de un solo clic.

Importando consultas

Para un ejemplo, importemos una que escribí. Descarga este archivo, luego abre el cuadro de diálogo de importación y selecciona el archivo para subirlo o pega la consulta en el cuadro de texto. Haz clic en Importar para guardarla y luego haz clic en Ejecutar para ver los resultados.

most-common-likers.dcquery (1).json (442 Bytes)

Parece que todos los desarrolladores de Discourse se gustan bastante :heart:

Buscando consultas

Si has acumulado demasiadas consultas increíbles, ¡no hay problema! La barra de búsqueda puede ayudarte a filtrar por títulos y descripciones.

Permitir que grupos no de personal ejecuten consultas

Puedes agregar grupos específicos (incluidos los moderadores) a una consulta para concederles acceso a ella:

Después de guardar, puedes encontrarla en la página de Grupos para ese grupo particular en la pestaña Informes:

Haz clic en cualquier consulta para abrirla y luego en el botón Ejecutar para ver los resultados. También puedes marcar como favoritas los informes de grupo haciendo clic en el botón Marcar como favorita.

Compartiendo consultas con parámetros predefinidos

Si has incluido parámetros definidos por el usuario en tu consulta, puedes compartir un enlace a la consulta e incluir los parámetros en la URL para que se rellenen automáticamente cuando se cargue la página.

Debes incluir los parámetros en la URL en este formato params={"nombre_del_parámetro":"valor"}. Separa múltiples parámetros con comas. Por ejemplo:

discourse.example.com/g/my-group/reports/6?params={"param1":"valor1","param2":"valor2"}

Combinado con el parámetro run mencionado anteriormente, puedes compartir un informe con parámetros predefinidos que se ejecute automáticamente al cargarse.

Límites de resultados y exportación de consultas

Con consultas grandes, es posible que notes que hay un límite en el número de filas que Data Explorer mostrará. Por defecto, el límite está establecido en 1000 filas. Esto es para evitar que consultas excesivamente grandes ralenticen o interrumpan el rendimiento de tu instancia de Discourse.

Si deseas omitir este límite, tienes varias opciones:

  1. Paginación: Puedes paginar tus resultados. En lugar de intentar devolver todos los resultados a la vez, puedes escribir tu consulta para devolver un rango específico de resultados. Luego puedes ajustar este rango para ver diferentes secciones de tus datos. Esto no aumentará el límite, pero te permitirá ver todos tus datos en secciones.
  2. Aumentar el límite: Si tienes acceso al servidor de Discourse y te sientes cómodo haciendo cambios en la configuración de Discourse, puedes aumentar el límite. Sin embargo, esto debe hacerse con precaución. Aumentar el límite puede poner mucha carga en tu servidor si no tienes cuidado, especialmente si varios usuarios ejecutan consultas grandes al mismo tiempo.
  3. Descargar los resultados: También tienes la opción de descargar los resultados de la consulta en lugar de verlos directamente en Discourse haciendo clic en el botón JSON o CSV después de ejecutar la consulta. Los datos descargados de una consulta en formato JSON o CSV tendrán un límite de resultados mucho más alto de 10,000 filas. Para fines programáticos, es mejor optar por el formato JSON, o si deseas trabajar con los datos en una aplicación de hoja de cálculo, el formato CSV podría ser más conveniente.

Generalmente es una buena idea intentar escribir consultas más eficientes o filtrar tus datos para que solo recuperes lo que necesitas, en lugar de intentar omitir el límite.

También puedes exportar la consulta SQL en formato .JSON haciendo clic en el botón Exportar. Las consultas exportadas de esta manera luego pueden importarse en otros sitios de Discourse o usarse con aplicaciones de terceros.

Plan de consulta

La casilla de verificación «Incluir plan de consulta» puede usarse para comprender y optimizar mejor tus consultas SQL.

Cuando marcas esta casilla y ejecutas una consulta, Discourse mostrará la secuencia de operaciones utilizadas para acceder a los datos en la base de datos de Discourse. Esto puede incluir operaciones como escaneos, uniones, ordenamientos y otras acciones de base de datos. Al examinar el plan de consulta, puedes ver exactamente cómo la base de datos está ejecutando tu consulta.

La serie de tutoriales de Data Explorer

También tenemos una serie dedicada sql-tutorial sobre Data Explorer! Si estás interesado en aprender más sobre cómo escribir consultas SQL en Discourse, recomendamos encarecidamente leer los temas de esta serie:

121 Me gusta
Data Explorer Tutorial - Part 1 - Writing Your First Query
Daily graph of user time online
Data Explorer Tutorial - Part 2 - Discourse SQL Basics
Formatting Data Explorer Table Results
Visual forum statistics
Extracting email addresses for a group
Visual map of users
How do I download a record of top posts or most clicked links?
Tags: how can admin see who is following what tags?
Can I see in the statistics which post received the most likes
External Data Analysis
Redesign of use profile
Can staff be able to see real author of anonymous posts
How to search/filter untagged topics
Exporting all Topic titles and IDs?
Retrieving user information via REST API
How to measure active users?
Discourse view file update does not reflect in browser
Scan IP matched accounts
Create report for amount of interactions per user
Where to find User ID information
CSV of all editeds post by moderator
Can I access my Discourse forum database?
How to look up a user based on a user_id?
Can I make a plug-ins to view a certain group of people?
Legal Tools Plugin
[Paid] Data explorer queries for ticketing system use case
Transactional Email Service (Open Source)
Direct connect to the Discourse Database
See what categories new users (& other trust levels) post in most
How can I extract the adminstrative records for a EU GDPR request?
Counting and reporting post views for commercial forum users (so we can charge them per-view)
Top user list public
How do I audit votes for fraudulent behavior
How do I get a list of all users from the API?
Tracking referrals? Encouraging users to invite others?
Display Data Explorer query results in WordPress (with TwigAnything)
Database's Data Model?
Filter or create statistics
How do I add users to a group?
Discourse disk space limits per user?
Masonry Image Gallery
Estimated timeline on a project?
Report on User Fields?
Dashboard - Segment number of Posts and Topics by team
Badge image missing issue
Traditional multi level hierarchy vs flat discourse hierarchy
Is there a Trust Level Permissions Table?
Deleting posts by banned users with < 3 posts?
Calculating "Top" topics in Discourse
Is there a way to Search by Posts with No Staff replies on it
How to use SQL to query discourse database
Specify user by external id
How to check the uniqueness of users in "hot link" badge?
Active users per day
Questions about moving an existing forum to Discourse
Get a user object by username or id javascript
Best Practices on reply-by-email
Most liked reply
Likes on a post
Group forum members based on topics viewed?
The metrics on dashboard, do they include activities from administrators?
Can I access Discourse forum Database to use for PowerBI reporting?
Is there a log of user visits?
Find posts "solved" in specific month
Anonymous User Groups
Any way to NOT send emails when a topic category is changed?
View/read by user or of user's posts?
After server migration the images in posts aren't downloadable anymore
Bug with [code]anything[/code] on a single line by itself
Logo is not appearing showing broken after upload
Configuring how users can create and send invites for others to join your community
Users reporting lots of 502 errors when attempting to post due to "max consecutive replies" check
Wildcard search
What would you like to see on your Discourse 2.0 Admin Dashboard?
TeamSpeak Usergroups Sync
Use tags to duplicate images?
Database Access required for our forum
Updated discourse and now site fails to display
Automatic badge expiration
Looking to switch from Vanilla, and have a few questions
Comment on a question instead of answering it
How to create custom reports
Deleted username but can not use that username in other user
Category Remains Muted after Category is available to Everyone
Can staff see who voters in anonymous polls?
Speak to a Discourse Data Analytic representative
How do I pull a report for a single community member?
Report Links to New Topics by Date?
Excluding Suspended, Silenced and Suspect Users When Exporting
Theme-Component v Plugin: What's the difference
Export topics to Excel
Is there a document introducing the database schema design?
Overview which trust level has which possibilities
Why are some users greyed out?
How to get reports for just a specific category?
How to get posts viewed by a user via APIs?
Reports for group message statistics
TimeStamp of Tag
How we put people in a category?
Is it possible to see the dates of all scheduled topics?
Topic Count Per User for Custom Date?
Searching for unassigned topics
Reports by Discourse
How to see all invites and invite tree?
How can I get the list of Discourse Topic IDs dynamically
How to edit sign up form?
Filter posts with images (gallery view)
Tracking unique contributors
New users who visited this month?
Making report on group membership?
Where to find post contents in the database
Searching All Messages as an Administrator
Are Staff and All Groups Included in Dashboard Reporting?
Deleted user with rails console u.delete -> email still "taken"
First Name, Last Name
User posts export as csv or text
User Messages Inbox Error 500
Description of fields returned by Discourse API
Failed to bootstrap due to out of memory killer
Inviting Feedback for Discourse Wiki ("Morphpedia")
What will happen to my forum if discourse suddenly stopped?
Why aren't warnings easily accessible like suspensions are?
Create a Data Explorer query using the API
Automate the syncing of Discourse queries to Google Sheets
Organization of community Data Explorer queries
Get total list of topics and their view counts from Discourse API
Working around the 10,000 result limit of data explorer?
Selecting the Quarter results in custom way
Create a Report on Profile data
Who marked Solution for Topic
Can you view a 'revised' post after it has been revised
More data from Admin reports
Regarding possibility to use Discourse as an alternative to JIRA or Zendesk
Retrieve latest posts by ID
More granular Discourse metrics?
Dump all conversations in a file and structured data
Login type report / list?
Special role to access dashboard
Best API for All First Posts in a Category
Data Explorer: Posts by Category (Including Subcategories)
Can the period stats use custom time frames to not be limited to only the most recent period?
Tracking who accepted which invite link
Advanced Search: Find posts having staff color
2021: The Year in Review
Filter topics not answered by Staff
Can I download a user database and sort by time viewed?
Category API request downloads all topics
User Data By Date Rage
Browse the Postgres database
How do I extract raw data from my discourse community site?
Some issues with searching (sorting, searching deleted posts and such)
How to Delete Uploaded Files?
How to show badges in the message list?
How to show badges in the message list?
How to find pageview data for a specific topic?
Badges for X Number of Solutions Created?
Permanent deletion bug
Adding SSO after many users already signed up -- how to migrate them?
How could I get voters from a poll?
Notifications from muted categories when mailing list mode is enabled
API: how to get joined at date in user summary
Edit a user preference for everyone or a subset of users
Create a Network chart of your forum - data visualization
Discourse Narrative Bot Data Explorer Queries :robot:
How do I get a report of total topics by subcategory for all subcategories please?
Plugin causing errors during rebuild
User field searching / reporting
Admin dashboard report reference guide
Comment, Question, & Discussion Level Agreement Voting - is there an extension?
How to find deleted posts
SQL query for last created users of the past 30 days
How can I see Survey Results or Responses
Is there a plugin for detecting forum access data?
How to show non-staff posts with zero replies
Viewing all published pages in a single site window
Accessing a user's chat activity
Configure Facebook login for Discourse
Admin Reporting & Analysis: Incremental Changes
Access to OpenID claims data?
How to calculate engagement rate for Discourse?
How to export more than the 10,000 limit?
`/admin/customize/permalinks` only shows ~100 permalinks
Can we delete all 'Automatically Bumped' msgs in one go?
User Status
Sort or Order post with combination of both (Replies + Activity)
Dynamically update available user field values during a profile fill in
Can I create a dashboard for a specific group inside the community?
Error during upgrading from Beta 3.1.x to latest
Must have plugins and components for Discourse?
Full IP access log
Available settings for global rate limits and throttling
How can I use GUI to access the postgresql db in docker
Data Explorer query for topics N+ days old, that are unsolved
Page Publishing
Tips for Exporting User Data
Identify private message interactions between users
View tag changes
Types of community & their characteristics
Discourse Chatbot :robot:
Run Data Explorer queries with the Discourse API
2023: The Year in Review
"Ensure ad-blockers are disabled and try reloading the page." when enabling Data Explorer
Exploring Discourse Data Explorer on my Sandbox
Order/Filter searched topics by latest update to First Post
Discourse Automation
API Filter users by emails, including secondary emails
How do I clear user warnings?
Exclude certain categories from the Trust Levels
Topic Ratings Plugin
Forum Data
Is it possible to view all staff notices?
Discourse Retort
Advice on archiving a site
Cleaning up uploads and purging uploads from S3
Content Audit : Report to pull Categories, Topics and Replies
Exporting all Forum Posts for Manual Upload into External LLMs?
discourse容器部署方式下,如何在外部连接到数据库,例如使用DBeaver连接
I'm attempting to merge user accounts
获取昨日点赞或者浏览量,前10的帖子
Populate Data Explorer params with URL params
AI sentiment and emotion analysis reports
Bulk Export of Raw Post Sources with Markup
Bundling more popular plugins with Discourse core
Setting up automated admin notice alerts
Listing event invitees with email addresses
More charting options for Data Explorer
Topics list filter feature
Migrate a phpBB3 forum to Discourse
Using Parameters in Data Explorer Queries
How to find how long a user has viewed a topic/who has posted new topics/country of users
Error trying to edit a post with an image in (NginX Proxy Manager?)
Restrict moderator access to only the stats panel on the admin dashboard?
How does auto-close topics work?
Poll: Export poll results in CSV for quiz creator?
Query to find out who marked the solution as solved
Possible to run a report for most posts within community?
Add an Admin subtab for Inactive users
Questions regarding Discourse features
How to query an email list of users that are not actived
Advice on a support forum
Shopify Integration
How do I see Facebook signups?
Creating and managing polls
Poll: Export poll results in CSV for quiz creator?
Discourse disk space limits per user?
Sorting all users by total posts?
SQL: The most N used words per user (speak their language!)
User Summary - Most Liked By user attributions are incorrect
Maximum Number of Search Results?
Get only top level posts in topic via discourse API
How to get all the deleted posts for a specific topic
Stats reports on a per-category basis?
Data analytics by complex networks and text mining
Error thrown when importing a query in Data Explorer
Zero search results searching private messages for specific keyword
A way to see full list of users granted with a certain badge?
Who messaged the most?
Who messaged the most?
How to open hyperlinks in a new tab
Run report of digest Unsubscribes
Need log the who downloaded attachments
Poll problem - exact vote numbers needed
Telegram Notifications Plugin (discourse-telegram-notifications)
Get last :heart: via API
Is it possible to keep the votes history of a poll?
How do I check a badge's status midway to it being awarded?
What plugins do you use - and why?
Export list of users based on date range
How to get all posts a user interacted with?
How can I email all recently active users?
Raw Function limited to 100