This is an automated email from the ASF dual-hosted git repository. hossman pushed a commit to branch SOLR-17335 in repository https://gitbox.apache.org/repos/asf/solr.git
commit 71983405239fc4b8740e73f9384b3ce4240cdc69 Author: Chris Hostetter <[email protected]> AuthorDate: Thu Jun 20 10:33:04 2024 -0700 Fix wording and missing renames --- .../query-guide/pages/dense-vector-search.adoc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc b/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc index d4ad9756176..35f5f094c68 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc @@ -238,9 +238,9 @@ client.add(Arrays.asList(d1, d2)); == Query Time -Apache Solr provides two query parsers that work with dense vector fields, that each support different ways of matching documents based on vector similarity: The `knn` query parser, and the `vecSim` query parser. +Apache Solr provides two query parsers that work with dense vector fields, that each support different ways of matching documents based on vector similarity: The `knn` query parser, and the `vectorSimilarity` query parser. -Both parsers return scores for retrieved documents that is the approximate distance to the target vector (defined by the similarityFunction configured at indexing time) and both support "Pre-Filtering" the document graph to reduce the number of candidate vectors evaluated (with out needing to compute their vector similarity distances). +Both parsers return scores for retrieved documents that are the approximate distance to the target vector (defined by the similarityFunction configured at indexing time) and both support "Pre-Filtering" the document graph to reduce the number of candidate vectors evaluated (with out needing to compute their vector similarity distances). Common parameters for both query parsers are: @@ -304,9 +304,9 @@ Here's an example of a simple `knn` search: The search results retrieved are the k=10 nearest documents to the vector in input `[1.0, 2.0, 3.0, 4.0]`, ranked by the `similarityFunction` configured at indexing time. -=== vecSim Query Parser +=== vectorSimilarity Query Parser -The `vecSim` vector similarity query parser matches documents whose similarity with the target vector is a above a minimum threshold. +The `vectorSimilarity` vector similarity query parser matches documents whose similarity with the target vector is a above a minimum threshold. In addition to the common parameters described above, it takes the following parameters: @@ -329,10 +329,10 @@ Minimum similarity threshold of nodes in the graph to be returned as matches + Minimum similarity of nodes in the graph to continue traversal of their neighbors -Here's an example of a simple `vecSim` search: +Here's an example of a simple `vectorSimilarity` search: [source,text] -?q={!vecSim f=vector minReturn=0.7}[1.0, 2.0, 3.0, 4.0] +?q={!vectorSimilarity f=vector minReturn=0.7}[1.0, 2.0, 3.0, 4.0] The search results retrieved are all documents whose similarity with the input vector `[1.0, 2.0, 3.0, 4.0]` is at least `0.7` based on the `similarityFunction` configured at indexing time @@ -346,9 +346,9 @@ Pre-Filtering the set of candidate documents considered when walking the graph c The `preFilter` parameter can be specified explicitly to reduce the number of candidate documents evaluated for the distance calculation: [source,text] -?q={!vecSim f=vector minReturn=0.7 preFilter=inStock:true}[1.0, 2.0, 3.0, 4.0] +?q={!vectorSimilarity f=vector minReturn=0.7 preFilter=inStock:true}[1.0, 2.0, 3.0, 4.0] -In the above example, only documents matching the Pre-Filter `inStock:true` will be candidates for consideration when evaluating the `vecSim` search against the specified vector. +In the above example, only documents matching the Pre-Filter `inStock:true` will be candidates for consideration when evaluating the `vectorSimilarity` search against the specified vector. The `preFilter` parameter may be blank (ex: `preFilter=""`) to indicate that no Pre-Filtering should be performed; or it may be multi-valued -- either through repetition, or via duplicated xref:local-params.adoc#parameter-dereferencing[Parameter References]. @@ -366,7 +366,7 @@ These two examples are equivalent: ==== Implicit Pre-Filtering -While the `preFilter` parameter may be explicitly specified on *_any_* usage of the `knn` or `vecSim` query parsers, the default Pre-Filtering behavior (when no `preFilter` parameter is specified) will vary based on how the query parser is used: +While the `preFilter` parameter may be explicitly specified on *_any_* usage of the `knn` or `vectorSimilarity` query parsers, the default Pre-Filtering behavior (when no `preFilter` parameter is specified) will vary based on how the query parser is used: * When used as the main `q` param: `fq` filters in the request (that are not xref:common-query-parameters.adoc#cache-local-parameter[Solr Post Filters]) will be combined to form an implicit Graph Pre-Filter. ** This default behavior optimizes the number of vector distance calculations considered, eliminating documents that would eventually be excluded by an `fq` filter anyway. @@ -379,7 +379,7 @@ The example request below shows two usages of vector query parsers that will get [source,text] ---- -?q=(color_str:red OR {!vecSim f=color_vector minReturn=0.7 v="[1.0, 2.0, 3.0, 4.0]"}) +?q=(color_str:red OR {!vectorSimilarity f=color_vector minReturn=0.7 v="[1.0, 2.0, 3.0, 4.0]"}) &fq={!knn f=title_vector topK=10}[9.0, 8.0, 7.0, 6.0] &fq=inStock:true ----
