opensearch-project / opensearch-project/sql

[RFC] SQL for Vector Search

Open
#2,847 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement RFC
Dominant language
Java
Stars
176
Forks
229
Avg merge
2d 21h
Merged PRs (30d)
43

Description

Search Queries in our organization are served by our in-house SQL. We have introduced SQL for Semantic search too.
Syntax: KNN (fieldName, EmbeddingList= [], K, Prefilters?)
wherein PreFilters are optional and can be any type of lexical expression combined that can by logical operators Like "AND"/ "OR"

Example-

SELECT uuid
  FROM table
  WHERE KNN(field1, [1.0, 4.0, 6.3, 8.1], 5,  country = "INDIA" AND rating > 3.4 ) ----> Prefilter

KNN is run only on documents satisfying pre-filters if exists.
Sample Query with both PreFilter and PostFilter

SELECT uuid
  FROM table
  WHERE KNN(field1, [1.0, 4.0, 6.3, 8.1], 5,  country = "INDIA" AND rating > 3.4 ) ----> Prefilter
    AND release_year >= 2020 ---> PostFilter

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue describes proposed KNN SQL syntax and prefilter/postfilter behavior but names no files, tests, or entry points. First clarify the intended implementation scope and acceptance criteria with maintainers; done should include an agreed design and corresponding support for the documented query forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.