webservice-solr icon indicating copy to clipboard operation
webservice-solr copied to clipboard

Simple schema

Open tonycoz opened this issue 6 years ago • 4 comments

simple wrapper around the schema API (and deals with the broken ordered keys they need)

tonycoz avatar Jun 14 '19 00:06 tonycoz

I'm sorry, I don't understand what this is. Please tell me what this code is for.

petdance avatar Jun 14 '19 00:06 petdance

It wraps the managed schema api:

https://lucene.apache.org/solr/guide/7_7/schema-api.html

so you can update the schema via WebService::Solr.

The schema() method is pretty simple, but the edit_schema() method deals with the strange ordered, duplicate key JSON objects to allow several schema updates in a simple request.

Hopefully the switch from "add-field-type" to "add_type" (briefer and a perl id for =>) makes it more usable too.

tonycoz avatar Jun 14 '19 01:06 tonycoz

I don't know anything about the schema API. I'm using Solr 4 in my day-to-day life.

Do we need to add docs and explanations about how and why to use this API?

petdance avatar Jun 14 '19 13:06 petdance

I think the examples provide enough information on how to use the API. For anything beyond that they'd need to check the schema documentation (which we might link to)

As to why, I've used the schema API to deploy a schema to a Solr server.

One other thing I considered adding to this was making the deploy_schema.pl example into a method (with some usability changes, so if no types are provided no type changes are deployed, etc)

tonycoz avatar Jun 15 '19 03:06 tonycoz