Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement schema API #255

Open
basdenooijer opened this issue Apr 17, 2014 · 7 comments
Open

Implement schema API #255

basdenooijer opened this issue Apr 17, 2014 · 7 comments

Comments

@basdenooijer
Copy link
Member

Since 4.2 Solr has a schema API: https://wiki.apache.org/solr/SchemaRESTAPI

Solarium should support this.

@bpolaszek
Copy link
Contributor

Since Solr 5.0 the Schema API is more complete:
https://cwiki.apache.org/confluence/display/solr/Schema+API

@eostis
Copy link

eostis commented Jun 29, 2017

Is there something new on the admin APIs of Solr ?

@haydenyoung
Copy link
Contributor

Is this still being considered for development? This would be a very useful feature especially when dealing with schemaless indexing.

@mkalkbrenner
Copy link
Member

We support the V1 CoreAdminAPI and the V1 CollectionsAPI partly. Other V1 APIs are not implemented.
But we added a generic implementation of the V2 API. Using it, you can do the V2 stuff mentioned in the docs:
https://lucene.apache.org/solr/guide/7_7/schema-api.html

See

public function testV2Api()
for an example

@alexander-schranz
Copy link
Contributor

Hello 👋

I'm very new to Solr and I created a new collection. Via Solarium client, but how can I define the schema. In #839 it was mention there is already a way to define a schema via solarium, but I could not find anything in the docs? Maybe somebody can push me into the right direction :)

@thomascorthals
Copy link
Member

@alexander-schranz I'm going to answer in #1049 because I think this is not quite what you're looking for.

@thomascorthals
Copy link
Member

You can use a generic API query to update a schema through the Schema API.

$query = $client->createApi([
'version' => Request::API_V1,
'handler' => $collection_or_core_name.'/schema',
'method' => Request::METHOD_POST,
'rawdata' => json_encode([
'add-dynamic-field' => [
'name' => 'attr_*',
'type' => 'text_general',
'indexed' => true,
'stored' => true,
'multiValued' => true,
],
]),
]);
$client->execute($query);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants