This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new dc60e3cbf8f example/films: README.md and vectors tweaks (#2238)
dc60e3cbf8f is described below

commit dc60e3cbf8fb69d9da0ed8bc53a6b0f47fc23192
Author: Christine Poerschke <[email protected]>
AuthorDate: Mon Jun 24 12:26:38 2024 +0100

    example/films: README.md and vectors tweaks (#2238)
    
    (cherry picked from commit 73b4043a389d3b19daf92cc005d8036b3e33f552)
---
 solr/example/films/README.md                                         | 2 +-
 solr/example/films/vectors/create_model.py                           | 2 +-
 solr/example/films/vectors/films.py                                  | 5 ++++-
 .../modules/getting-started/pages/tutorial-vectors.adoc              | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/solr/example/films/README.md b/solr/example/films/README.md
index 0e7229df720..a42e097cc8b 100644
--- a/solr/example/films/README.md
+++ b/solr/example/films/README.md
@@ -1,6 +1,6 @@
 We have a movie data set in JSON, Solr XML, and CSV formats.  All 3 formats 
contain the same data.  You can use any one format to index documents to Solr.
 
-This example uses the `_default` configset that ships with Solr plus some 
custom fields added via Schema API.  It demonstrates the use of ParamSets in 
conjunction with the [Request Parameters 
API](https://solr.apache.org/guide/solr/latest/configuration-guide/request-parameters-api.html).
+This example uses the `_default` configset that ships with Solr plus some 
custom fields added via Schema API as described 
[here](https://solr.apache.org/guide/solr/latest/getting-started/tutorial-vectors.html#preparing-for-the-vector-data)
 in the Solr Reference Guide.  It demonstrates the use of ParamSets in 
conjunction with the [Request Parameters 
API](https://solr.apache.org/guide/solr/latest/configuration-guide/request-parameters-api.html).
 
 The original data was fetched from Freebase and the data license is present in 
the films-LICENSE.txt file.  Freebase was shutdown in 2016 by Google.
 
diff --git a/solr/example/films/vectors/create_model.py 
b/solr/example/films/vectors/create_model.py
index 84a437aa57a..abbd03c2723 100755
--- a/solr/example/films/vectors/create_model.py
+++ b/solr/example/films/vectors/create_model.py
@@ -50,7 +50,7 @@ pathlib.Path("./models/").mkdir(parents=True, exist_ok=True)
 model = SentenceTransformer("all-mpnet-base-v2")
 
 # New size for the embeddings
-new_dimension = 10
+new_dimension = films.FILMS_MODEL_NEW_DIMENSION
 
 
 ######## Evaluate performance of full model ########
diff --git a/solr/example/films/vectors/films.py 
b/solr/example/films/vectors/films.py
index cd1a712eb39..acf211125c7 100644
--- a/solr/example/films/vectors/films.py
+++ b/solr/example/films/vectors/films.py
@@ -15,13 +15,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import os
 import json
 import csv
 from lxml import etree
 from sentence_transformers import SentenceTransformer
 
+FILMS_MODEL_NEW_DIMENSION = int(os.getenv("FILMS_MODEL_NEW_DIMENSION", "10"))
+
 PATH_FILMS_DATASET      = "../films.json"
-PATH_FILMS_MODEL        = "./models/films-model-size_10"
+PATH_FILMS_MODEL        = 
f"./models/films-model-size_{FILMS_MODEL_NEW_DIMENSION}"
 PATH_FILMS_VECTORS_JSON = "./data/films-vectors.json"
 PATH_FILMS_VECTORS_XML  = "./data/films-vectors.xml"
 PATH_FILMS_VECTORS_CSV  = "./data/films-vectors.csv"
diff --git 
a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc 
b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc
index 42a3174658f..63cffc16542 100644
--- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc
+++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc
@@ -111,7 +111,7 @@ be used as the input vector for all the following example 
queries.
 [NOTE]
 ====
 Interested in calculating the vector using Solr's 
xref:query-guide:streaming-expressions.adoc[streaming capability]?   
-Here is an example of a streaming expression that you can run via the Solr 
Admin Stream UI:
+Here is an example of a streaming expression that you can run via the 
xref:query-guide:stream-screen.adoc[Solr Admin Stream UI]:
 ```
 let(
   a=select(      

Reply via email to