11# linkml-solr
22
3- A simple wrapper for using Solr with [ LinkML] ( https://linkml.io ) schemas
3+ A simple wrapper for using [ Solr] with [ LinkML] ( https://linkml.io ) schemas
44
5- This provides a convenience layer for working with a Solr database
5+ This provides a convenience layer for working with a [ Solr] database
66whose schema is defined in LinkML. It provides bindings both from
77slots in your schema to queries, and binds result objects to your
88object model.
@@ -20,7 +20,7 @@ for book in result.items:
2020 print (f ' Book: { book.name} :: { book} ' )
2121```
2222
23- Unlike querying with the native pysolr API, this will validate input
23+ Unlike querying with the native [ pysolr] API, this will validate input
2424keys (which your IDE will be aware of), and will instantiate an
2525instance of your model class.
2626
@@ -33,9 +33,9 @@ instance of your model class.
3333See [ tests/test_models/books.yaml] ( tests/test_models/books.yaml ) for an example schema
3434
3535The Schema must be specified as a [ LinkML schema] ( https://linkml.io/linkml/schemas/index.html ) . Note that LinkML is
36- more expressive than solr schemas, so not all constructs can be
37- used. However, certain inferences are performed when compiling to Solr
38- schemas - for example, you can use inheritance, and leaf classes will have all slots inferred.
36+ more expressive than [ Solr schemas] , so not all constructs can be
37+ used. However, certain inferences are performed when compiling to [ Solr
38+ schemas] - for example, you can use inheritance, and leaf classes will have all slots inferred.
3939
4040Your schemas should be relatively "flat and wide". Use denormalization over nesting.
4141
@@ -46,7 +46,7 @@ When designing your schema consider the two different paradigms supported:
4646
4747Note: you can use the linkml-model-enrichment toolkit to auto-infer schemas from data
4848
49- In future there will be ways to annotate your schema to give hints when making solr indexers etc.
49+ In future there will be ways to annotate your schema to give hints when making Solr indexers etc.
5050
5151## Step 2: Create Python dataclasses
5252
@@ -60,13 +60,13 @@ See [tests/test_models/books.py](tests/test_models/books.py) for an example
6060
6161## Step 3: Start a server
6262
63- This starts a server, precreates a core "books" and loads a solr schema from a linkml schema:
63+ This starts a server, precreates a core "books" and loads a Solr schema from a linkml schema:
6464
6565``` bash
6666lsolr start-server -C books -s books.yaml
6767```
6868
69- This wraps a docker container. If you do not wish to use a Docker container, then start solr in the usual way
69+ This wraps a docker container. If you do not wish to use a Docker container, then start [ Solr ] in the usual way
7070
7171TODO: docs on how to do this
7272
@@ -150,3 +150,7 @@ Alpha code. Functionality is very incomplete
150150 - automatic de-nesting/de-normalization
151151 - autogen of model-specific API
152152 - expose additional solr functionality
153+
154+ [Solr] : https://solr.apache.org/
155+ [Solr schemas] : https://solr.apache.org/guide/solr/latest/indexing-guide/schema-elements.html
156+ [pysolr] : https://github.com/django-haystack/pysolr?tab=readme-ov-file# pysolr
0 commit comments