lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] Commented: (SOLR-239) Read IndexSchema from InputStream instead of Config file
Date Fri, 01 Jun 2007 23:38:16 GMT


Hoss Man commented on SOLR-239:

FWIW: I really don't think preserving getIputStream() is really necessary, but as a public
method it shouldn't' be removed without discussion.

Thinking about this whole issue a little bit more now, am i correct in understanding that
your original goal was to allow clients to parse a remote schema as an InputStream (fetched
from the server via a URL).

i have to question whether it really makes sense for clients to use the IndexSchema class
... it requires a lot of baggage (like all of the field types and all of the analyzers) that
are probably overkill for most clients, and break the abstraction solr provides where clients
only need to know about fields names, and the server takes care of the rest.  A simple DOM
model of hte schema.xml seems like it would really solve 99.9999% of the problems clients
might need.

But for the purposes of this discussion let's focus on the other 0.0001% of the problems...

Making Config.openResource(String) support URLs might be a little overkill for achieving the
immediate goal, and it seems like it would raise a lot more questions then it may solve.

Why not just add an IndexSchema(URL) constructor...

 * add new private URL schemaUrl
 * add new IndexSchema(URL) constructor that sets schemaUrl and calls readConfig()
 * modify getInputStream to return Config.openResource(schemaFile) only if it's not null,
otherwise return URL.openStream()

(this doesn't preclude or make more complex any possible future decision to allow Config.openResource
to support URLs) 

while we're at it we should probably...
 * change the private readConfig to take an InputStream as a param
   * modify the constructors that call readConfig to pass an explict InputStream made from
their input
 * deprecate public getInputStream()

> Read IndexSchema from InputStream instead of Config file
> --------------------------------------------------------
>                 Key: SOLR-239
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.2
>         Environment: all
>            Reporter: Will Johnson
>            Priority: Minor
>             Fix For: 1.2
>         Attachments: IndexSchemaStream.patch, IndexSchemaStream2.patch, IndexSchemaStream2.patch,
> Soon to follow patch adds a constructor to IndexSchema to allow them to be created directly
from InputStreams.  The overall logic for the Core's use of the IndexSchema creation/use does
not change however this allows java clients like those in SOLR-20 to be able to parse an IndexSchema.
 Once a schema is parsed, the client can inspect an index's capabilities which is useful for
building generic search UI's.  ie provide a drop down list of fields to search/sort by.  

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message