You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Pranaya Behera <pr...@igp.com> on 2016/08/09 12:52:15 UTC

Getting dynamic fields using LukeRequest.

Hi,
      I have the following script to retrieve all the fields in the 
collection. I am using SolrCloud 6.1.0.
LukeRequest lukeRequest = new LukeRequest();
lukeRequest.setNumTerms(0);
lukeRequest.setShowSchema(false);
LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient);
Map<String, LukeResponse.FieldInfo> fieldInfoMap = 
lukeResponse.getFieldInfo();
for (Map.Entry<String, LukeResponse.FieldInfo> entry : 
fieldInfoMap.entrySet()) {
   entry.getKey(); // Here fieldInfoMap is size of 0 for sometime and 
sometime it is getting incomplete data.
}


Setting showSchema to true doesn't yield any result. Only making it 
false yields result that too incomplete data. As I can see in the doc 
that it has more than what it is saying it has.

LukeRequest hits 
/solr/product/admin/luke?numTerms=0&wt=javabin&version=2 HTTP/1.1 .

How it should be configured for solrcloud ?
I have already mentioned

<requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />

in the solrconfig.xml. It doesn't matter whether it is present in the 
solrconfig or not as I am requesting it from solrj.


Re: Getting dynamic fields using LukeRequest.

Posted by Pranaya Behera <pr...@igp.com>.
Hi,
      With solrj I am getting inconsistent results. Previously it was 
working great. But now it is not giving any expanded results while 
querying the same search in solr admin it gives the expanded query. When 
I say previously is that after the first release of 6.1.0, now 
LukeRequest is not working, getExpandedResults() always gives me 0 docs. 
Only expanded result works in solr admin but not the LukeRequest, for 
LukeRequest I have to query on each shard to get all the dynamic indexed 
fields.
Any solutions to this ?  Please mention if any response is needed.

On 10/08/16 11:49, Pranaya Behera wrote:
> And also when I hit the request for each individual shard I get some 
> results that are close to it using /admin/luke endpoint but to the 
> whole collection it doesnt even show that have dynamic fields.
>
> On 10/08/16 11:23, Pranaya Behera wrote:
>> Hi Steve,
>>               I did look at the schema api but it only gives the 
>> defined dynamic fields not the indexed dynamic fields. For indexed 
>> fields with the rule of the defined dynamic field I guess LukeRequest 
>> is the only option. (Please correct me if I am wrong.)
>>
>> Hence I am unable to fetch each and every indexed field with the 
>> defined dynamic field.
>>
>> On 09/08/16 19:26, Steve Rowe wrote:
>>> Not sure what the issue is with LukeRequest, but Solrj has Schema 
>>> API support: 
>>> <http://lucene.apache.org/solr/6_1_0/solr-solrj/org/apache/solr/client/solrj/request/schema/SchemaRequest.DynamicFields.html>
>>>
>>> You can see which options are supported here: 
>>> <https://cwiki.apache.org/confluence/display/solr/Schema+API#SchemaAPI-ListDynamicFields>
>>>
>>> -- 
>>> Steve
>>> www.lucidworks.com
>>>
>>>> On Aug 9, 2016, at 8:52 AM, Pranaya Behera <pr...@igp.com> 
>>>> wrote:
>>>>
>>>> Hi,
>>>>      I have the following script to retrieve all the fields in the 
>>>> collection. I am using SolrCloud 6.1.0.
>>>> LukeRequest lukeRequest = new LukeRequest();
>>>> lukeRequest.setNumTerms(0);
>>>> lukeRequest.setShowSchema(false);
>>>> LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient);
>>>> Map<String, LukeResponse.FieldInfo> fieldInfoMap = 
>>>> lukeResponse.getFieldInfo();
>>>> for (Map.Entry<String, LukeResponse.FieldInfo> entry : 
>>>> fieldInfoMap.entrySet()) {
>>>>   entry.getKey(); // Here fieldInfoMap is size of 0 for sometime 
>>>> and sometime it is getting incomplete data.
>>>> }
>>>>
>>>>
>>>> Setting showSchema to true doesn't yield any result. Only making it 
>>>> false yields result that too incomplete data. As I can see in the 
>>>> doc that it has more than what it is saying it has.
>>>>
>>>> LukeRequest hits 
>>>> /solr/product/admin/luke?numTerms=0&wt=javabin&version=2 HTTP/1.1 .
>>>>
>>>> How it should be configured for solrcloud ?
>>>> I have already mentioned
>>>>
>>>> <requestHandler name="/admin/luke" 
>>>> class="org.apache.solr.handler.admin.LukeRequestHandler" />
>>>>
>>>> in the solrconfig.xml. It doesn't matter whether it is present in 
>>>> the solrconfig or not as I am requesting it from solrj.
>>>>
>>
>


Re: Getting dynamic fields using LukeRequest.

Posted by Pranaya Behera <pr...@igp.com>.
And also when I hit the request for each individual shard I get some 
results that are close to it using /admin/luke endpoint but to the whole 
collection it doesnt even show that have dynamic fields.

On 10/08/16 11:23, Pranaya Behera wrote:
> Hi Steve,
>               I did look at the schema api but it only gives the 
> defined dynamic fields not the indexed dynamic fields. For indexed 
> fields with the rule of the defined dynamic field I guess LukeRequest 
> is the only option. (Please correct me if I am wrong.)
>
> Hence I am unable to fetch each and every indexed field with the 
> defined dynamic field.
>
> On 09/08/16 19:26, Steve Rowe wrote:
>> Not sure what the issue is with LukeRequest, but Solrj has Schema API 
>> support: 
>> <http://lucene.apache.org/solr/6_1_0/solr-solrj/org/apache/solr/client/solrj/request/schema/SchemaRequest.DynamicFields.html>
>>
>> You can see which options are supported here: 
>> <https://cwiki.apache.org/confluence/display/solr/Schema+API#SchemaAPI-ListDynamicFields>
>>
>> -- 
>> Steve
>> www.lucidworks.com
>>
>>> On Aug 9, 2016, at 8:52 AM, Pranaya Behera <pr...@igp.com> 
>>> wrote:
>>>
>>> Hi,
>>>      I have the following script to retrieve all the fields in the 
>>> collection. I am using SolrCloud 6.1.0.
>>> LukeRequest lukeRequest = new LukeRequest();
>>> lukeRequest.setNumTerms(0);
>>> lukeRequest.setShowSchema(false);
>>> LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient);
>>> Map<String, LukeResponse.FieldInfo> fieldInfoMap = 
>>> lukeResponse.getFieldInfo();
>>> for (Map.Entry<String, LukeResponse.FieldInfo> entry : 
>>> fieldInfoMap.entrySet()) {
>>>   entry.getKey(); // Here fieldInfoMap is size of 0 for sometime and 
>>> sometime it is getting incomplete data.
>>> }
>>>
>>>
>>> Setting showSchema to true doesn't yield any result. Only making it 
>>> false yields result that too incomplete data. As I can see in the 
>>> doc that it has more than what it is saying it has.
>>>
>>> LukeRequest hits 
>>> /solr/product/admin/luke?numTerms=0&wt=javabin&version=2 HTTP/1.1 .
>>>
>>> How it should be configured for solrcloud ?
>>> I have already mentioned
>>>
>>> <requestHandler name="/admin/luke" 
>>> class="org.apache.solr.handler.admin.LukeRequestHandler" />
>>>
>>> in the solrconfig.xml. It doesn't matter whether it is present in 
>>> the solrconfig or not as I am requesting it from solrj.
>>>
>


Re: Getting dynamic fields using LukeRequest.

Posted by Pranaya Behera <pr...@igp.com>.
Hi Steve,
               I did look at the schema api but it only gives the 
defined dynamic fields not the indexed dynamic fields. For indexed 
fields with the rule of the defined dynamic field I guess LukeRequest is 
the only option. (Please correct me if I am wrong.)

Hence I am unable to fetch each and every indexed field with the defined 
dynamic field.

On 09/08/16 19:26, Steve Rowe wrote:
> Not sure what the issue is with LukeRequest, but Solrj has Schema API support: <http://lucene.apache.org/solr/6_1_0/solr-solrj/org/apache/solr/client/solrj/request/schema/SchemaRequest.DynamicFields.html>
>
> You can see which options are supported here: <https://cwiki.apache.org/confluence/display/solr/Schema+API#SchemaAPI-ListDynamicFields>
>
> --
> Steve
> www.lucidworks.com
>
>> On Aug 9, 2016, at 8:52 AM, Pranaya Behera <pr...@igp.com> wrote:
>>
>> Hi,
>>      I have the following script to retrieve all the fields in the collection. I am using SolrCloud 6.1.0.
>> LukeRequest lukeRequest = new LukeRequest();
>> lukeRequest.setNumTerms(0);
>> lukeRequest.setShowSchema(false);
>> LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient);
>> Map<String, LukeResponse.FieldInfo> fieldInfoMap = lukeResponse.getFieldInfo();
>> for (Map.Entry<String, LukeResponse.FieldInfo> entry : fieldInfoMap.entrySet()) {
>>   entry.getKey(); // Here fieldInfoMap is size of 0 for sometime and sometime it is getting incomplete data.
>> }
>>
>>
>> Setting showSchema to true doesn't yield any result. Only making it false yields result that too incomplete data. As I can see in the doc that it has more than what it is saying it has.
>>
>> LukeRequest hits /solr/product/admin/luke?numTerms=0&wt=javabin&version=2 HTTP/1.1 .
>>
>> How it should be configured for solrcloud ?
>> I have already mentioned
>>
>> <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
>>
>> in the solrconfig.xml. It doesn't matter whether it is present in the solrconfig or not as I am requesting it from solrj.
>>


Re: Getting dynamic fields using LukeRequest.

Posted by Steve Rowe <sa...@gmail.com>.
Not sure what the issue is with LukeRequest, but Solrj has Schema API support: <http://lucene.apache.org/solr/6_1_0/solr-solrj/org/apache/solr/client/solrj/request/schema/SchemaRequest.DynamicFields.html>

You can see which options are supported here: <https://cwiki.apache.org/confluence/display/solr/Schema+API#SchemaAPI-ListDynamicFields>

--
Steve
www.lucidworks.com

> On Aug 9, 2016, at 8:52 AM, Pranaya Behera <pr...@igp.com> wrote:
> 
> Hi,
>     I have the following script to retrieve all the fields in the collection. I am using SolrCloud 6.1.0.
> LukeRequest lukeRequest = new LukeRequest();
> lukeRequest.setNumTerms(0);
> lukeRequest.setShowSchema(false);
> LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient);
> Map<String, LukeResponse.FieldInfo> fieldInfoMap = lukeResponse.getFieldInfo();
> for (Map.Entry<String, LukeResponse.FieldInfo> entry : fieldInfoMap.entrySet()) {
>  entry.getKey(); // Here fieldInfoMap is size of 0 for sometime and sometime it is getting incomplete data.
> }
> 
> 
> Setting showSchema to true doesn't yield any result. Only making it false yields result that too incomplete data. As I can see in the doc that it has more than what it is saying it has.
> 
> LukeRequest hits /solr/product/admin/luke?numTerms=0&wt=javabin&version=2 HTTP/1.1 .
> 
> How it should be configured for solrcloud ?
> I have already mentioned
> 
> <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
> 
> in the solrconfig.xml. It doesn't matter whether it is present in the solrconfig or not as I am requesting it from solrj.
> 


Fwd: Getting dynamic fields using LukeRequest.

Posted by Pranaya Behera <pr...@igp.com>.


-------- Forwarded Message --------
Subject: 	Getting dynamic fields using LukeRequest.
Date: 	Tue, 9 Aug 2016 18:22:15 +0530
From: 	Pranaya Behera <pr...@igp.com>
To: 	solr-user@lucene.apache.org



Hi,
       I have the following script to retrieve all the fields in the
collection. I am using SolrCloud 6.1.0.
LukeRequest lukeRequest = new LukeRequest();
lukeRequest.setNumTerms(0);
lukeRequest.setShowSchema(false);
LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient);
Map<String, LukeResponse.FieldInfo> fieldInfoMap =
lukeResponse.getFieldInfo();
for (Map.Entry<String, LukeResponse.FieldInfo> entry :
fieldInfoMap.entrySet()) {
    entry.getKey(); // Here fieldInfoMap is size of 0 for sometime and
sometime it is getting incomplete data.
}


Setting showSchema to true doesn't yield any result. Only making it
false yields result that too incomplete data. As I can see in the doc
that it has more than what it is saying it has.

LukeRequest hits
/solr/product/admin/luke?numTerms=0&wt=javabin&version=2 HTTP/1.1 .

How it should be configured for solrcloud ?
I have already mentioned

<requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />

in the solrconfig.xml. It doesn't matter whether it is present in the
solrconfig or not as I am requesting it from solrj.