queryterm

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package queryterm holds the query-side vocabulary rules that both ways of searching this graph have to agree on: the full-text query built for the database, and the term list the fallback scan matches nodes against. A word dropped by one and kept by the other makes the two tools disagree about what the searcher asked for.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropFunctionWords

func DropFunctionWords(tokens []string) []string

DropFunctionWords removes meaningless words from a query's terms, and gives up when that would leave nothing. @intent stop one unremarkable English word from deciding which results a query returns. @domainRule a query made only of function words keeps every term, so it stays answerable.

func IsFunctionWord

func IsFunctionWord(term string) bool

IsFunctionWord reports whether a term is one of the meaningless words. @intent let a caller judge one term without copying the list.

func IsNaturalLanguage added in v0.14.0

func IsNaturalLanguage(query string) bool

IsNaturalLanguage reports whether a query should retrieve documents by any meaningful term and let shared scoring combine the evidence.

Two or three code terms are normally a partially remembered identifier and retain strict all-term matching. Prose either announces itself with a question word or contains more than three meaningful terms. The count happens after function-word removal so "get user by id" remains the compact identifier-shaped query "get user id". @intent choose soft retrieval only for sentence-shaped queries while preserving precise identifier lookup. @domainRule compact queries of at most three meaningful terms remain strict unless their grammar explicitly asks a question.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL