mirror of
https://github.com/alexpasmantier/television.git
synced 2025-07-29 14:21:43 +00:00
1 line
4.9 KiB
JavaScript
1 line
4.9 KiB
JavaScript
"use strict";(self.webpackChunktelevision_website=self.webpackChunktelevision_website||[]).push([[2811],{7658:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>a,frontMatter:()=>l,metadata:()=>n,toc:()=>h});const n=JSON.parse('{"id":"Users/search-patterns","title":"Search Patterns","description":"Tv uses a fuzzy matching algorithm to filter its list of entries. Its behavior depends on the input pattern you provide.","source":"@site/../docs/01-Users/06-search-patterns.md","sourceDirName":"01-Users","slug":"/Users/search-patterns","permalink":"/television/docs/Users/search-patterns","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":6,"frontMatter":{},"sidebar":"docSidebar","previous":{"title":"Shell Integration","permalink":"/television/docs/Users/shell-integration"},"next":{"title":"Channels","permalink":"/television/docs/Users/channels"}}');var r=s(3420),i=s(5404);const l={},c="Search Patterns",d={},h=[];function o(e){const t={a:"a",code:"code",em:"em",h1:"h1",header:"header",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"search-patterns",children:"Search Patterns"})}),"\n",(0,r.jsx)(t.p,{children:"Tv uses a fuzzy matching algorithm to filter its list of entries. Its behavior depends on the input pattern you provide."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Matcher"}),(0,r.jsx)(t.th,{style:{textAlign:"center"},children:"Pattern"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fuzzy"}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"foo"})})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Substring"}),(0,r.jsxs)(t.td,{style:{textAlign:"center"},children:[(0,r.jsx)(t.code,{children:"'foo"})," / ",(0,r.jsx)(t.code,{children:"!foo"})," to negate"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Prefix"}),(0,r.jsxs)(t.td,{style:{textAlign:"center"},children:[(0,r.jsx)(t.code,{children:"^foo"})," / ",(0,r.jsx)(t.code,{children:"!^foo"})," to negate"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Suffix"}),(0,r.jsxs)(t.td,{style:{textAlign:"center"},children:[(0,r.jsx)(t.code,{children:"foo$"})," / ",(0,r.jsx)(t.code,{children:"!foo$"})," to negate"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Exact"}),(0,r.jsxs)(t.td,{style:{textAlign:"center"},children:[(0,r.jsx)(t.code,{children:"^foo$"})," / ",(0,r.jsx)(t.code,{children:"!^foo$"})," to negate"]})]})]})]}),"\n",(0,r.jsx)(t.p,{children:'These patterns (and matchers) can be associated (as "AND") to express complex search queries such as:'}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:"car 'bike !^car !bike$\n"})}),"\n",(0,r.jsx)(t.p,{children:"which translates to:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:"anything that:\n- fuzzy matches `car`\n- contains the exact substring `bike`\n- does not start with `car`\n- does not end with `bike`\n"})}),"\n",(0,r.jsx)(t.p,{children:"And will produce the following results:"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"haystack"}),(0,r.jsx)(t.th,{style:{textAlign:"center"},children:"match"}),(0,r.jsx)(t.th,{style:{textAlign:"center"},children:"explanation"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:(0,r.jsx)(t.em,{children:"the car drove past the bike"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"\u274c"}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"ends with bike"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:(0,r.jsx)(t.em,{children:"car, bike or bus?"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"\u274c"}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"starts with car"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:(0,r.jsx)(t.em,{children:"the black motorbike flew past the tourists"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"\u2705"}),(0,r.jsx)(t.td,{style:{textAlign:"center"}})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:(0,r.jsx)(t.em,{children:"the motorbike flew past the tourists"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"\u274c"}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:"doesn't contain 'car'"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For more information on the matcher behavior, see the\n",(0,r.jsx)(t.a,{href:"https://docs.rs/nucleo-matcher/latest/nucleo_matcher/pattern/enum.AtomKind.html",children:"nucleo-matcher"})," documentation."]})]})}function a(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}}}]); |