# Term search (IDF) inside the file jsonW stores the sparse term vector with IDF weights in the row itself and scores it with the avaliar command, with no separate search engine. November 13, 2026 · jsonW 1.3.11 · https://jsonw.org/en/newsroom/term-search ## The problem To find documents by word, most systems keep an index in a separate search engine and sync it with the data. When the data changes and the index does not, search returns stale results. ## How jsonW solves it A column of type mapa stores each row's sparse vector: the term number and its weight, computed with IDF, the same math search engines use. The query brings its own terms and weights, and avaliar takes the dot product with every row and returns the best ones. It reads only the requested column, in parallel. ``` $ wjsw de-texto "id:i64,produto:texto,categoria:dic,preco:decimal[2],nota:f64,vet:vf16[4],termos:mapa" prod.jsonl prod.jsw 5 linhas -> prod.jsw $ wjsw avaliar prod.jsw esparso termos "12=1,90=0.5" 2 1.2000000476837158 0 {id:1,produto:"Café especial",…,termos:[[12,1.2000000476837158],[40,0.4000000059604645]]} 1.0 4 {id:5,produto:"Suco de uva",…,termos:[[12,0.30000001192092896],[90,1.399999976158142]]} ``` Real wjsw output: score, row position and the row. The query asked for term 12 with weight 1 and term 90 with weight 0.5. ## Where it is In the tool, wjsw avaliar … esparso; in the ABI and the 10 SDKs, the same request in JSON, with the same result byte for byte. jsonW stores and scores the terms; turning text into term numbers is your application's job. Read the full section in the paper: https://jsonw.org/paper/en#busca