Discourse Data Explorer

:discourse2: Summary Discourse Data Explorer allows you to make SQL queries against your live database, allowing for up-to-the-minute stats reporting.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

:information_source: If you’re looking for examples or support for any custom queries, you can find lots of topics in our Data & reporting category under the sql-query tag. If there’s not one to suit your particular needs, please feel free to create a new topic to ask the community for some help. :memo: Query Help

:discourse2: Hosted by us? This plugin is available on our Business and Enterprise plans. Data Explorer | Discourse - Civilized Discussion

After installing the plugin, head to /admin/plugins .

de1

Click on the “Settings” button, and turn on data explorer enabled, then return and reload the page.
There should now be a tab in the stacked nav called “ Data Explorer ”. Select it or head to /admin/plugins/explorer , then use the + , Import or Run buttons to get started.

Default queries

On a fresh install, the data explorer now ships with several queries that can help you draw insights from your forum’s activity. Open any query and click Run to try it out.

Here's what the stock queries look like.

Note: Default queries are picked up from this file: discourse-data-explorer/lib/discourse_data_explorer/queries.rb at main · discourse/discourse-data-explorer · GitHub

If you have an awesome query that you want everyone to have, make a PR just like this one.

Default queries cannot be edited, feel free to copy the sql and paste it into a new query if you’d like to modify them.

Writing queries

When you click any of the Edit buttons on a query view, or start a new Explorer Query, you are presented with a screen like the one below:

The top two boxes are the name and description of the query. The name is what you’re selecting in the dropdown box, and the description should be used for things like explaining what to put in the query parameters or to describe what data is being queried.

The left pane is where you write the SQL query. Minor syntax highlighting and checking is provided.

Automatically running queries

While you can always run a query by clicking the Run button, you can save time when loading a query by adding the run parameter to the URL.

For example: /admin/plugins/explorer/queries/123?run

When this parameter is added to the URL, the query will run as soon as you load the page, so you don’t need to click the Run button to see the results. This is especially helpful for queries you run frequently, allowing you to bookmark them or add them to your sidebar with the run parameter included for a one-click report.

Importing queries

For an example, let’s import one that I wrote. Download this file, then open the import dialog and select the file to be uploaded or paste the query in the text box. Click Import to save it and then click Run to see the results.

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

Looks like all of the Discourse developers like each other quite a bit :heart:

Searching for queries

If you’ve accumulated too many awesome queries, no problem! The search bar can help you filter through titles and descriptions.

Allow non-staff groups to run queries

You can add specific groups (including moderators) to a query to grant them access to it:

After saving, you can find it from the Groups page for that particular group on the Reports tab:

Click any query to open it and then the Run button to see the results. You can also bookmark group reports by clicking the Bookmark button.

Sharing queries with predefined parameters

If you have included user-defined parameters in your query, you can share a link to the query and include the parameters in the URL so they will be pre-filled when the page loads.

You must include parameters in the URL in this format params={"parameter_name":"value"}. Separate multiple parameters with commas. For example:

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

Couple with the run parameter mentioned above, you can share a report with predefined parameters that runs automatically when loaded.

Result limits and exporting queries

With large queries, you may notice that there is a limit on the number of rows that the Data Explorer will display. By default, the limit is set to 1000 rows. This is to prevent excessively large queries from slowing down or disrupting the performance of your Discourse instance.

If you want to bypass this limit, you have a few of options:

  1. Pagination: You can paginate your results. Instead of trying to return all results at once, you can write your query to return a specific range of results. You can then adjust this range to view different sections of your data. This won’t increase the limit, but it will allow you to view all your data in sections.
  2. Increase the limit: If you have access to the Discourse server and are comfortable making changes to Discourse settings, you can increase the limit. However, this should be done with caution. Increasing the limit can put a lot of load on your server if you’re not careful, especially if multiple users are running large queries at the same time.
  3. Download the Results: You also have the option to download the query results instead of viewing them directly in Discourse by clicking either the JSON or CSV button after running the query. Data downloaded from a query in JSON or CSV format will have a much higher results limit of 10,000 rows. For programmatic purposes, you want want to opt for the Json format, or if you’d like to work on the data in a spreadsheet application, the CSV format might be more convenient.

It’s generally a good idea to try and write more efficient queries, or to filter your data so that you’re only retrieving what you need, rather than trying to bypass the limit.

You can also export the SQL query itself in .JSON format by clicking the Export button. Queries that are exported using this method can then be imported into other Discourse sites, or used with third party applications.

Query plan

The “Include query plan” checkbox can be used for better understanding and optimizing your SQL queries.

When you check this box and run a query, Discourse will display the sequence of operations used to access data in the Discourse database. This can include operations like scans, joins, sorts, and other database actions. By examining the query plan, you can see exactly how the database is executing your query.

The Data Explorer tutorial series

We also have a dedicated sql-tutorial series about the Data Explorer! If you’re interested in learning more about writing SQL queries in Discourse, we highly recommend reading through the topics in this series:

119 个赞
Data Explorer Tutorial - Part 1 - Writing Your First Query
Utilizing Parameters in Data Explorer Queries
Daily graph of user time online
Data Explorer Tutorial - Part 2 - Discourse SQL Basics
Visual forum statistics
Formatting Data Explorer Table Results
Extracting email addresses for a group
Visual map of users
Tags: how can admin see who is following what tags?
Can I see in the statistics which post received the most likes
How do I download a record of top posts or most clicked links?
Retrieving user information via REST API
Redesign of use profile
External Data Analysis
Exporting all Topic titles and IDs?
How to search/filter untagged topics
Can staff be able to see real author of anonymous posts
How to look up a user based on a user_id?
Discourse view file update does not reflect in browser
Can I access my Discourse forum database?
Legal Tools Plugin
Scan IP matched accounts
Create report for amount of interactions per user
Can I make a plug-ins to view a certain group of people?
Install Discourse on Ubuntu or Debian for Development
CSV of all editeds post by moderator
Where can I see the code for Dashboard Reports?
Where to find User ID information
How-to export list of all topics in csv?
How to measure active users?
Community Guide: Activating Lurkers
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?
Can Discourse produce a list of the emails that I have sent invitations to
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
Migrate a phpBB3 forum to Discourse
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?
How might I list users that the system will soon delete?
How might I list users that the system will soon delete?
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
How to check how many users are using Facebook login?
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?
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
Deleting group with 404 error
Data Explorer unusual error on a site on which DE only recently installed
Data Explorer unusual error on a site on which DE only recently installed
Theme-Component v Plugin: What's the difference
Cannot create new query in Data Explorer anymore
Export topics to Excel
Overview which trust level has which possibilities
Discourse Assign
Why are some users greyed out?
How to get reports for just a specific category?
User_ip_address_histories is not populated
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?
How to send an original email to users
Unable to delete all of a users posts 500 server error
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
Users removed themselves from Private Messages (PM) and then the mods can't see their PM history
User posts export as csv or text
User Messages Inbox Error 500
User posts export as csv or text
Is there an easy way to see which categories have the most views?
Description of fields returned by Discourse API
Is there a document introducing the database schema design?
Failed to bootstrap due to out of memory killer
Search Logs - How to get a complete list for a given date range?
Inviting Feedback for Discourse Wiki ("Morphpedia")
What will happen to my forum if discourse suddenly stopped?
Users removed themselves from Private Messages (PM) and then the mods can't see their PM history
Why aren't warnings easily accessible like suspensions are?
Dump posts as emails
Best way to get (via API) a list of users from a group, and their bios
Organization of community Data Explorer queries
Data Explorer - Vote count
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
See who is watching a topic
See who is watching a 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?
See who is watching a topic
Dump all conversations in a file and structured data
Login type report / list?
Special role to access dashboard
Final deletion does not work correctly
Best API for All First Posts in a Category
Data Explorer: Posts by Category (Including Subcategories)
Users removed themselves from Private Messages (PM) and then the mods can't see their PM history
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
Grant a custom badge through the API
2021: The Year in Review
Filter topics not answered by Staff
How does auto-close topics work?
Can I download a user database and sort by time viewed?
Search User by Associated Account (easier way)
Category API request downloads all topics
User Data By Date Rage
Browse the Postgres database
Suggestions related to tagging (download, "improved" upload)
How do I extract raw data from my discourse community site?
Some issues with searching (sorting, searching deleted posts and such)
Exclude staff from statistics
Search User by Associated Account (easier way)
How to Delete Uploaded Files?
"View query in Data Explorer" option when sending data explorer queries via PM is broken for Discourse subfolder installs
How to show badges in the message list?
How to show badges in the message list?
Error trying to edit a post with an image in (NginX Proxy Manager?)
How to find pageview data for a specific topic?
Badges for X Number of Solutions Created?
Permanent deletion bug
Automatically email admin report CSVs on a recurring cadence
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
Building an Index from topics
Edit a user preference for everyone or a subset of users
Create a Network chart of your forum - data visualization
Exclude users from analytics
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
Add additional fields in category list REST API
Chat activity in Community health / Reports data
Filter assigned topics by status
Completely deleting previous versions of a post or message
Is there a plugin for detecting forum access data?
Is there a plugin for detecting forum access data?
How to show non-staff posts with zero replies
Can I find out who are 'new contributors'?
How to handle a null id nicely
Data explorer taking instance down on rebuild
Get count of recent flags in a particular category
Data explorer taking instance down on rebuild
Data explorer taking instance down on rebuild
How to get the DAU and MAU data separately?
Automatically email admin report CSVs on a recurring cadence
People receiving reminders even though they've accepted the policy
How many views a topic (with no replies) has got?
How can I generate to PDF or Word doc. etc. a full list of topic headings per subcategory please?
Get count of recent flags in a particular category
Is it possible to disallow revoking agreement to certain policies?
Is there a cakeday/birthday list?
How can I enable: Auto-hyperlinking text to reference to other posts?
Viewing all published pages in a single site window
Use API to get topics for a period using js
How to determine category id
If a user post an anonymous topic, is he really anonymous to admin and hosting company?
What if badges could optionally synchronize group membership?
Accessing a user's chat activity
Does the data explorer support json extracts?
Discourse Disorder
A summary of votes by topic, including tags
Users removed themselves from Private Messages (PM) and then the mods can't see their PM history
Search and export messages
Who read posts at a certain time?
A chat channel doesn’t show nor save messages
Display the user who marked the answer as correct
Upgrade failed (NoMethodError: undefined method `register_bookmarkable' for Bookmark:Class)
Configure Facebook login for Discourse
How many TL3 users do you have? Do the TL3 requirements really make sense?
Access to OpenID claims data?
Do these new badges come bundled with the plugin?
Oembed Discovery - What is being talked about?
Bulk deletion of topics
Download posts resolved
How to query the topics_with_no_response.json API with filters
How to calculate engagement rate for Discourse?
Need assistance with massive amounts of spam
Need assistance with massive amounts of spam
How to export more than the 10,000 limit?
`/admin/customize/permalinks` only shows ~100 permalinks
What rails command can give me 'User-ID' from a username/user-email?
How to learn more about Discourse back-end?
If a Wiki post is editable by non-staff, shouldn't there be an option to allow those who can edit the post to see all the edits to it?
Can we delete all 'Automatically Bumped' msgs in one go?
Disabling outgoing email notifications
I can't seem to be able to locate when this notification is configured from?
Add additional fields in category list REST API
A chat channel doesn’t show nor save messages
User Status
Compromised Forum Admin
Discourse Data Explorer Query Response to Slack
Sort or Order post with combination of both (Replies + Activity)
Polls - add all poll options to CSV export
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
Get member count overall by month using Data Explorer
Data discrepancy in user post counts
Is there any way to pull in bulk all topics/posts and DMs with a certain keyword?
Is there an easy way to see which categories have the most views?
Nice Post vs Nice Reply badge
Badge queries using "badge_posts" table aren't awarded for non-public categories
How to use capture groups in a regex in Data explorer?
How to escape a colon in Data Explorer?
PG::ReadOnlySqlTransaction: ERROR: cannot execute SELECT in a read-only transaction
Problem testing Badge Query from Data Explorer
Is there any way of telling how popular a Theme is?
Data Explorer - Query to determine user theme preferences
Number of posts on topics where poster is not the author?
Failed to process hijacked response correctly : Couldn't find Topic with 'id'=569
iOS 16 web push notifications in 2023
Can I undelete a custom user field?
Can't run query in data explorer plugin
Error on rebuild : No child processes (Errno::ECHILD) from /pups/lib/pups/exec_command.rb:88:in `block in spawn'
Posts failed to import from phpBB3
Trying to query to find user custom fields filled out
Amount of time spent reading by Discourse groups
Displaying user custom fields in data explorer query results
Discourse metrics
Data Explorer query help: metrics to understand unique individual participants
Awarding badges multiple times with custom SQL
Is it possible to get a list of topics in a category read by a specific user?
Must have plugins and components for Discourse?
Find the users which are more likely to become TL3
Is it possible to move all the attachments to Drive or similar?
Is there a way to create a tag visible to mods only?
I want to count each user’s monthly statistics
Tracking of Pageviews and Unique Users at Category and Tag Level
Recommnded plugins for supporting a tech community run by a big enterprise?
Tracking of Pageviews and Unique Users at Category and Tag Level
Identifying posts that haven't been resolved automatically
Writing Feature
Create list of links to all soft-deleted posts
Can't get access to a query
Can I create a new query in Data Explorer using API?
Automation script Schedule PM with Data Explorer results not sending PMs
Automation script Schedule PM with Data Explorer results not sending PMs
Automation script Schedule PM with Data Explorer results not sending PMs
Chat activity in Community health / Reports data
Automation script Schedule PM with Data Explorer results not sending PMs
Discourse Database with Dummy Data
Automation script Schedule PM with Data Explorer results not sending PMs
How to filter topics by user group
Full IP access log
Is there any way of viewing more than 50 results when searching for text to customise?
Can anyone using multisite give me an idea of how likely plugins and components are to work please
Enabling AI Bot in Chat
How to see exact link of ‘top referred topics’
What unit on user_visits.time_read?
Community Guide: Activating Lurkers
Available settings for global rate limits and throttling
Can anyone using multisite give me an idea of how likely plugins and components are to work please
Data explorer queries category header background is transparent
Discourse AI + Data Explorer?
Discourse AI + Data Explorer?
Discourse AI + Data Explorer?
Get aggregate user location data from IP addresses?
Discourse AI + Data Explorer?
How can I use GUI to access the postgresql db in docker
Disable or remove likes from a post
Export badges list
Unable to install Data Explorer Plugin last version
Data-Explorer Automated Emails?
Getting NameError (uninitialized constant DataExplorer::Poll) while enabling Data explorer plugin
What is the difference between user_id and current_user_id
Is it possible to give an alias to a query parameter?
`DataExplorer::ValidationError: Missing parameter` when running Data Explorer queries with [params] via API
How to delete system queries in Data Explorer?
Data-Explorer Automated Emails?
Notification of trust level downgrade
Data explorer challenge: Generate list of members by location
Discourse AI + Data Explorer?
PAID Data explorer challenge: chronological list of user topics started, replied and liked
Query for WAU/MAU
Report for top page hit counter and page generation time per IP address or user
Wish list: sticky table headers
User login history
Searching for posts created within a specific timeframe
Is there a way to create a report on how many users posted new queries each month?
Find users who read specific topics
Data Explorer query for topics N+ days old, that are unsolved
Data Explorer: Posts by Category (Including Subcategories)
Moderator Dashboard: Potential Areas of Concern Report
"View query in Data Explorer" option when sending data explorer queries via PM is broken for Discourse subfolder installs
Data Explorer query for topics N+ days old, that are unsolved
Can anyone using multisite give me an idea of how likely plugins and components are to work please
People misusing possible loopholes when PMs are disabled?
Could we re-open the topic to share Explorer queries?
Page Publishing
Search / Watching for Tags only populates Topics with the tag, not replies
Error 422 when reordering categories
Tips for Exporting User Data
Ability to create a user group with the "inverse" of users with an email domain
Documentation of the entire database
Get topic count per month for a certain category
How to measure active users?
How can I count posts in last month by a specific group of users?
How do I stop a runaway data explorer query?
Is it possible to view all users with a signature?
Complex user activity report requirement
Any idea how to send metric reports as private message?
Data explorer queries similar to dashboard stats
Identifying users in multiple groups using AND rather than OR?
Discourse report and superset integration
Identify private message interactions between users
View tag changes
Staff member didn't get notification when task assigned
Best way to show Data Explorer data on an external website?
Enhance About page website statistics
Enhance About page website statistics
How to get the number of mentions groups have had over the past year, and number of members
Is it possible to give an alias to a query parameter?
What are the optional integer values for the "permissions.everyone" field in the "Creates a category" API?
Grant Badge when user visits link
Types of community & their characteristics
Restrict moderator access to only the stats panel on the admin dashboard?
Restrict moderator access to only the stats panel on the admin dashboard?
How to fetch posts/topics by multiple usernames
Discourse Chatbot :robot:
Filter search results solved by specific user
/?status=deleted filter crashes browsers
Who can access other people's Personal Chats?
Discourse AI + Data Explorer?
Query to create some groups based on activity
Statistics on most-liked posts of all time?
Run Data Explorer queries with the Discourse API
Show subscription status on tag overview and make it editable
Expose Category and Group IDs to admins
Expose Category and Group IDs to admins
How to find how long a user has viewed a topic/who has posted new topics/country of users
Automatic Dark Mode
Automatic Dark Mode
Sidekiq 100% CPU usage and no mails
2023: The Year in Review
Slow Data Explorer queries
Slow Data Explorer queries
Moderation tools for chat?
Is there a way to see how many posts in a topic in a particular month?
Is there a way to export topics/posts that are displayed when filtering?
Is there a way to export topics/posts that are displayed when filtering?
Discourse query for total read time
Votes not being returned on topic close
Sudden increase in emails
Unanswered Filter
Title field export on user profile
Thousands of user api requests and invalidation
Gamification and invitations
Convert a category to private and add users to a specific group with access
New user alerts
"Ensure ad-blockers are disabled and try reloading the page." when enabling Data Explorer
"Ensure ad-blockers are disabled and try reloading the page." when enabling Data Explorer
What's the cause of the 'unmet peer dependency' messages?
Thousands of user api requests and invalidation
Thousands of user api requests and invalidation
Tracking topic views history
Votes not being returned on topic close
Discourse Show Fullname in Mentions
Introduce a way to also permanently delete the sensitive info from the staff logs
Is there a way to see an overview of which categories have Solved enabled?
Why isn't Discourse more frequently recommended as a "community platform"?
Howto/doc on 'data explorer'
Time to first response by group members
Data Explorer Categories Permissions
Restrict moderator access to only the stats panel on the admin dashboard?
Daily Summary Feedback
Any way to select all topics in a search query?
Migrate or move Discourse content into a blog post - HOW?
Can you check when a Data Explorer query has been run and how many times?
Title field export on user profile
Get list of invited users
A silver badge for _each_ 5 bronze badges
Disappearing bookmarks and expected behavior of /bookmarks
Auditing moderator/admin activity associated with user data
Auditing moderator/admin activity associated with user data
Data migration for external reporting purposes
How many topics (first post) are submitted through mobile / desktop?
How to create a data explorer query with the APIs?
Exploring Discourse Data Explorer on my Sandbox
Is there a way to create a report on how many users posted new queries each month?
Need data explorer query to export an entire topic
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
Experimental topics list filter feature
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
How to get posts viewed by a user via APIs?
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
Populating a custom user data field
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?
Search Logs - How to get a complete list for a given date range?
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?
Community Guide: Activating Lurkers
Raw Function limited to 100
[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

你好! :slight_smile:

我在这个帖子中询问了如何复制搜索查询中所有主题的链接。我被引导到这里。所以,我问了我们的论坛的管理员,我们是否安装了这个插件,我们确实安装了。但是,我们不知道如何使用它来使用这个插件将搜索查询中的所有链接复制到CSV文件中。有人以前做过这件事吗?也许可以指引我们一下? :sweat_smile:

请注意,我是论坛的普通用户,我没有管理权限。但是,我正在将此信息转达给有权限的网站管理员,他可以为我做这件事。 :slight_smile:

提前感谢!

你好 Preston!

Data Explorer 插件允许你创建 SQL 查询。

你想创建一个新的查询来列出你正在寻找的主题。

然后,当你运行查询时,你会看到一个 CSV 按钮,用于将结果导出到 CSV 文件。

希望这有帮助!

如果你在创建查询方面需要更多帮助,请告诉我们!

3 个赞

谢谢!我会转达的 :拥抱:

3 个帖子已拆分为新主题:如何解决 Data Explorer 10,000 条结果限制问题?

您好,我有一个关于这个很棒插件的功能请求。

我使用数据探索器创建的一些报告,如果我能在仪表板报告(/admin/reports)页面列出它们,对我的团队将非常有帮助。

是否可以为每个数据探索器查询添加一个选项,使其能在报告页面列出?谢谢。

例如:

  • 报告页面列出此自定义查询
3 个赞

感谢这个功能!

我正在探索如何编写自定义指标。我们正在将 Discourse 与 Workadvent.re(一个基于 2D 头像的 A/V 协作工具)一起使用。
我正在那里运行一个自定义脚本,通过 webhook 将活动记录到 Google 表格中。为了将所有内容集中在我们核心工具(Discourse)中,将这些数据打印到 Discourse 中将非常棒……
有什么建议吗?!

1 个赞

我真的很希望有一个查询生成器可以帮助编写 SQL。我的 SQL 很老旧而且生疏,手动编写 SQL 容易出错且耗时。如果有一种更简单的方法就好了!

2 个赞

您好 @davidgs,欢迎来到 Meta :wave: :slight_smile:

您尝试过使用像 ChatGPT 这样的 LLM 吗?它对 Discourse 有相当的理解,并且在我需要制作数据探索器查询时也相当可靠。

我经常这样写提示:“编写一个 Discourse 数据探索器查询,从 a,b,c 中返回 x,y,z,其中…” 然后就能得到相当不错的结果。

在本页的右上角,您可能还会看到一个小机器人图标,如下所示。
image

如果那里有的话,您也可以尝试集成在 Meta 中的 AI Helper Bot。

2 个赞

我们大多数人都看不到它。但总有 ask.discourse.com

2 个赞

是的,我不记得这是否仍然只是一个3级信任才能使用的功能。你推荐的ask.discourse.com网站是个好主意。

作为参考示例,我将“写一个 discourse 数据探索查询,返回所有说过“software”一词的用户列表”输入到ask.discourse.com的文本输入栏中,得到了以下查询:

SELECT 
    p.user_id, 
    u.username,
    COUNT(p.id) AS post_count
FROM 
    posts p
JOIN 
    users u ON u.id = p.user_id
WHERE 
    p.raw ILIKE '%software%'
GROUP BY 
    p.user_id, u.username
ORDER BY 
    post_count DESC;

这相当合理。我还可以证明它能处理比这复杂得多的查询。

2 个赞

我安装 Discourse 和 Data Explorer 的最新更新大约两个小时后,数据浏览器的导出数据不再有效。数据本身创建正常,但无法再导出。

点击 JSON 或 CSV 按钮只会闪烁一下,然后什么也没发生。大约两周前它还能正常工作。

在网络浏览器控制台中,我看到以下错误:
CSV:

Uncaught TypeError: this.args.query is undefined
    _downloadResult query-result.js:310
    downloadResultCsv query-result.js:287
    _triggerAction d-button.gjs:160
    Ember 12
    _triggerAction d-button.gjs:157
    click d-button.gjs:106

JSON:

Uncaught TypeError: this.args.query is undefined
    _downloadResult query-result.js:310
    downloadResultJson query-result.js:283
    _triggerAction d-button.gjs:160
    Ember 12
    _triggerAction d-button.gjs:157
    click d-button.gjs:106
1 个赞

感谢您的 bug 报告,@GuidoD

我今天早些时候合并了一个针对此问题的修复程序,请尝试更新并确认它是否对您有效。 :slight_smile:

2 个赞

感谢您快速修复。
我可以确认它又可以正常工作了。

1 个赞

少量数据导出到 JSON 和 CSV 都可以正常工作。但对于大量数据,CSV 导出工作正常,但 JSON 导出在 nginx 中会导致 502 错误网关(可能是因为 30 秒后超时,而 JSON 文件创建时间超过 30 秒)。

有没有简单的方法可以增强 nginx 的超时值?

如果我缩短查询的时间范围,csv 文件为 12.9 MB,json 文件为 645 MB。总的 csv 文件为 13.5 MB,只比这个大一点点,但 json 文件由于 nginx 错误而未创建。

或者,JSON 文件创建是否由于某些奇怪的数据而出错?JSON 文件创建会生成日志文件吗?

JSON 查询默认比 CSV 查询运行更高的外部 LIMIT。在查询内部添加自定义分页以确保其按时完成。

1 个赞

是否可以从数据浏览器执行 UPDATE 语句?

我正在尝试对某个表进行批量更新,但出现此错误:

PG::FeatureNotSupported: ERROR:  WITH 查询“query”不包含 RETURNING 子句
第 29 行: ) SELECT * FROM query

不,Data Explorer 仅执行只读事务。(如果您更新查询以包含 RETURNING 子句,您将收到只读事务错误。)

如果您是自托管用户,请使用“启动器输入”指南之一,例如

如果您已经设计好 UPDATE,那么您可以 psql discourse 而不是 rails c

如果您使用的是托管服务,请联系支持部门让他们执行更改。

1 个赞

感谢您的回复。说得通。我们使用的是托管服务,所以我会联系他们的支持团队。

如果我与版主组共享 SQL 查询,该组中的用户如何从他们的帐户运行查询?他们看不到数据浏览器插件。