When I search for suttas your software quite often fails to find them, but I know they are there. For example, i entered āDiscourse on the Ten Dhammas. Dasadhamma suttaā.
In monastic chanting books some suttas go by a different name from that which they have in the Tipiį¹aka.
The ANās Dasadhammasutta is one example. In the Tipiį¹aka itās called either the Pabbajitaabhiį¹hasutta or the Abhiį¹hapaccavekkhaį¹adhammasutta.
Indeed yes. What Iād like to do is assemble a list of aliasses so we can create appropriate search results, eg. for the Metta Sutta, another big one.
In this case, a web search for dasadhammasutta returns Access to Insight, where this sutta is listed as AN 10.48. You can then enter that number on SuttaCentral.
2 posts were merged into an existing topic: Bless us with your sparkling love
let us know any mistakes and typos
In general, thatās too many words for a search. If you know the Pali, just search for that. In general. It wouldnāt have helped in this case. Words like ādiscourseā ātenā and āDhammasā are too common to be useful when searching.
I donāt know how I would go about this task, but Iām happy to have a discussion about it and take it from there.
You would edit this file:
It is rather short at the moment!
I just did a wildcard search which took quite a while (the first time I did it)
aį¹įø*
While searching the orange context_toolbar displayed
SuttaCentral ā Search results
then
0 search:resultsFor aį¹įø*
then
9265 results for aį¹įø*
Once some form of browser caching has happened, step 2 doesnāt happen. I first experienced this in Saf, but had to reproduce it by searching in FF.
The faults in step two are both the search:search in the (black) breadcrumb bar and the wonky-donk search:resultsFor in the context_toolbar
Iām not sure what is going on.
However I have long noticed that immediately the page displays 0 results and then later updates. This is wrong. If you are running a local version of the site maybe itās not there long enough to matter. But it should not work like that.
Thoughts @agilgur5 ?
Also, wildcard searching doesnāt work (consistently) ![]()
Sorry, I missed that.
I donāt think we support wild card searching at all, do we? Probably that * is just getting ignored.
We do have the partial match toggle.
However for strings as small as the one you are searching for, itās going to be really difficult. Especially if the diacritics are being ignored.
Personally I use the DPR for Pali searching.
Even sadder. Especially in a language with so much declention.
I moved on to searching longer terms!
https://thebuddhaswords.net/ is still my go to for search. Itās just a tiny little .js file but it does a pretty good job, minus the diacritics.
That appears to be the localization key, I think bugging out around this bit of code.
EDIT: Iām pretty sure itās the extra whitespace causing that key to not be interpreted correctly, as the localize function doesnāt trim it
EDIT2: Nope, not quite. The problem is that the localization isnāt loading until after the search request finishes, and applies to the one below too. I suspect that may be due to the until directive, see some analysis in the PR where I refactored this (while attempting to fix it).
probably ditto for this bit
EDIT: this one is weirder, it only appears in one place that seems to be correct and has an old bug report too
EDIT2: see āEDIT2ā in the above section
That seems like a simple case of the number being reset when the query starts. To not have confusing display, it should say something like āSearchingā¦ā instead, specifically when the request is in-flight
Itās quite possible that the search back end is stripping the diacritics, leaving the english word and.
The layout on the search page is extremely wonky-donk and somebody has gone and made it worse by hacking styles into the html of several key layout divs. Can you hear the devas sobbing?
It is particularly bad on mobile but not great on desktop.
So I did what any person who had too much caffeine would do and got stuck in to the css.
<div class="all-search-results" style="/*! flex-direction: row; */">
<section class="additional-search-results" style="/*! max-width: 40%; */">
Both of these need their hardcoded style removed. ![]()
All of the following classes need updating.
If SC actually used stylesheets in normal ways I would have been happy to provide a new stylesheet. ![]()
@media (max-width: 780px) {
.all-search-results {
flex-direction: column-reverse;
gap: var(--sc-size-xl);
}
.primary-search-results {
max-width: 100%;
width: 100%;
}
.additional-search-results {
max-width: 100%;
width: 100%;
}
}
@media (max-width: 600px) {
.sutta-info {
display: flex;
flex-direction: column;
}
.sutta-title {
flex-direction: column;
}
dictionary + .suttaplex {
margin-top: var(--sc-size-xs);
}
}
.search-results-main {
max-width: 1440px;
margin: 0px auto;
padding-bottom: 64px;
width: 90vw;
}
.all-search-results {
display: flex;
flex-direction: row;
gap: var(--sc-size-xl);
}
.additional-search-results {
max-width: 40%;
}
.search-result-head, .primary-search-results {
display: flex;
flex-direction: column;
max-width: 720px;
min-width: 40%;
flex-grow: 2;
}
.search-result-item {
border-bottom: var(--sc-border);
display:flex;
flex-direction:column;
}
.item-head {
display: flex;
justify-content: space-between;
flex-direction: row;
max-width:100%;
}
.primary {
display: flex;
flex-flow: nowrap;
justify-content: space-between;
align-items: center;
min-height: 32px;
}
.sutta-info{
width:calc(100% - 70px);
flex-direction:column;
display:flex;
}
.search-result-action-items {
display: flex;
align-items: center;
flex-direction: row;
width: 40px;
}
.search-result-title {
font-family: var(--sc-serif-font);
font-weight: 400;
font-size: var(--sc-font-size-xl);
margin: 0px;
color: var(--sc-primary-color);
display: flex;
align-items: center;
}
.badges {
display: flex;
margin-left: 0.3em;
margin-bottom: 0.5em;
width:150px;
}
I agree, it can overlap weirdly on different screen sizes.
Multi-column also feels a bit unintuitive to me as search pages are mostly single column these days.
They appear to be set in JavaScript conditionally in this function. Could have JS set conditional CSS classes instead
Bhante Sujato likes to follow web standards and features. Shadow DOM is a browser feature for encapsulation so that things like styles donāt leak across components. Web Components typically use it.
Iāve used React components since the early days of ~2014 and still like CSS modules, but those all have hashes and such, so not so easy to edit either. Pros and cons of different approaches and such.
Anyway, the search styles are mostly in this file
Thanks for highlighting this. Now I understand the thinking, though I donāt agree with it (more on that later).
More importantly, I found a bug ![]()
searching title: rahula returns
Search format error
filter "title:" Missing Values
Whereas title:rahula works.
Can we strip any space that comes between the colon and the first character?
I totally agree with this. I think itās fine to serve multi column search results for medium and large screens but we need to make some decisions about how to handle things on xs and s devices (phone sized).
There are definite issues in the .search-results-item regardless of single or multi column layouts which I will look at in github, but shall we start a new conversation about search multi-column layout so as to not derail the bug thread?
Iām not sure if this is a bug or not. Maybe I donāt understand what āmatch partialā does.
If I search rahula with match partial on. The orange bar tells me that there are 502 results.
In the primary-search-results column I see one lonely result.
Chapter Three
Root language: PÄli aligned
AN 1.209ā218 Tatiyavagga ā English ā Bhikkhu Sujato
Then a āload moreā button. Which doesnāt do anything.
Followed by a whole lot of white space
Then in the additional-search-results column I have Rahulaās dictionary entry (which is quite long) and way down scrolling-scrolling there are 18 suttaplex cards,
By my maths thatās 19 results plus a dictionary entry.
When I search un-partially(?)
I get 116 results
The additional-search-results column contains the same dictionary entry plus 18 suttaplex cards.
The primary-search-results column leads with the same AN1 Chapter 3 entry and then is followed by another 19 Suttas,
Then a āload moreā button, which gives me 20 or so more suttas and the option to load another 20 or so.
All these entries have the entire word RÄhula in them, some more than once.
It seems like I am getting less āclickableā results from a partial search than an un-partial one.
Is this right?
(Iām just searching Rahula as a test, because it (should) returm a whole lot of results).
I have moved discussion about search layout to a new thread





