lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-9205) Parse schema in LukeResponse
Date Fri, 30 Sep 2016 10:00:29 GMT

    [ https://issues.apache.org/jira/browse/SOLR-9205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15535589#comment-15535589
] 

ASF subversion and git services commented on SOLR-9205:
-------------------------------------------------------

Commit f13b727213e1e843c1a8d0dc2f3930d80f23b11f in lucene-solr's branch refs/heads/master
from [~romseygeek]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=f13b727 ]

SOLR-9205: Parse schema in LukeResponse


> Parse schema in LukeResponse
> ----------------------------
>
>                 Key: SOLR-9205
>                 URL: https://issues.apache.org/jira/browse/SOLR-9205
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>            Reporter: Fengtan
>            Priority: Minor
>             Fix For: 6.3
>
>         Attachments: SOLR-9205.patch, SOLR-9205.patch, SOLR-9205.patch
>
>
> LukeRequestHandler (/admin/luke) lists schema flags using two fields named "schema" and
"flags".
> For instance on my local machine http://localhost:8983/solr/collection1/admin/luke returns
something like this:
> {code:xml}
> <lst name="id">
>   <str name="type">string</str>
>   <str name="schema">I-S-----OF-----l</str>
> </lst>
> {code}
> And http://localhost:8983/solr/collection1/admin/luke?show=schema returns something like
this:
> {code:xml}
> <lst name="id">
>   <str name="type">string</str>
>   <str name="flags">I-S-----OF-----l</str>
> </lst>
> {code}
> However, when processing a LukeRequest in SolrJ, only the "flags" field is parsed into
a Set of FieldFlag objects. The "schema" field is left as a String, and as a result is hard
to process by client applications who do not know how to parse "I-S-----OF-----l".
> Here is an example that illustrates the problem:
> {code}
> public class MyClass {
>   public static void main(String[] args) throws Exception {
>     SolrClient client = new HttpSolrClient("http://localhost:8983/solr/collection1");
>     LukeRequest request = new LukeRequest();
>     LukeResponse response = request.process(client);
>     for (LukeResponse.FieldInfo field:response.getFieldInfo().values()) {
>       System.out.println(field.getSchema());
>       // field.getSchema() returns "I-S-----OF------" (i.e. a String) which is not much
meaningful for SolrJ applications
>       // Ideally field.getSchema() should return something like "[INDEXED, STORED, OMIT_NORMS,
OMIT_TF]" (i.e. a EnumSet<FieldFlag>) which is meaningful for SolrJ applications
>     }
>   }
> }
> {code}
> It is probably fine to parse both fields the same way in SolrJ since LukeRequestHandler
populates them [the same way|https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java#L288].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message