Searching by knitspeak snippets

Posted 30 Apr 2020 by JC

Now this is a fun one! Today’s new feature is the ability search by little snippets of knitspeak, like “k1 tbl” or “[yo, k1] 5 times.”

Give it a try: go to the Browse page, or to the detail page for any collection, and find the “Knitspeak snippets” section in the “Search options” box.

screenshot: empty input box

Enter any bit of knitspeak, and you’ll see all the stitch patterns whose written instructions include that bit of knitspeak.

screenshot: k1 tbl

Along with those search results, you’ll also see another empty input box. Enter another snippet into that box, and you’ll see all patterns that contain both snippets – for example, both “k1 tbl” and “RT.”

screenshot: k1 tbl AND RT

What if you want to find all the patterns whose written instructions contain either “w&t” or “turn”? Easy: in a single box, enter “w&t | turn.” The vertical bar (found on most keyboards above the “\” character) means “or,” and you can have as many of them as you like in one input box.

screenshot: w&t | turn

This allows all sorts of trickery – for example, all patterns that make use of twisted stitches and short rows:

screenshot: k1 tbl | p1 tbl AND w&t | turn

But wait, there’s more! Start a snippet with “^” (the character above “6” on most keyboards) and that snippet will be excluded from the search results. So this will search for patterns that are not worked in the round:

screenshot: ^Round

This will search for patterns that feature yarn overs, but not the most common single decreases:

screenshot: yo AND ^ k2tog | ssk | p2tog

Of course you can combine any of these “Knitspeak snippets” search options with other search options. Here’s a way to find patterns that use “brSl” symbols but haven’t been tagged as “brioche”:

screenshot: with brSl but not tagged as brioche

Or patterns named “Feather and fan” that don’t have yarn overs:

screenshot: named Feather and Fan without yo


All the comparisons are case-insensitive, so “sl1” will match “sl1” or “Sl1.” But other than being case-insensitive, the comparisons are very literal.

  • “Row 1” (without an “s”) will not match “Rows 1 and 2.”
  • “k2 , p1” (with an extra space before the comma) will not match “k2, p1.”
  • “LT” will match “1/1 LT” and “multiple of 5 sts” (because of the “lt” in “multiple”).

Why are the comparisons so literal? Because they’re done on the actual knitspeak for each stitch pattern, exactly as it’s shown on the pattern’s detail page and – more to the point – as it’s stored in the site’s database. Doing comparisons on the knitspeak stored in the database is what makes the searches so fast and so powerful.

Speak up!

As always, I’ve tested on a number of browsers, with Javascript both enabled and disabled... but who knows what I missed? Who knows how your browser might behave differently? If you notice any weirdness, please let me know! Or if you have ideas for making this feature better, please join the conversation on Ravelry.

« Previous article • Next article »

News archives