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 Jorge Luis Betancourt Gonzalez <jl...@uci.cu> on 2014/09/23 17:02:12 UTC

Changed behavior in solr 4 ??

Hi:

I’m trying to change the default configuration for the query component of a SearchHandler, basically I want to set a default value to the rows parameters and that this value be shared by all my SearchHandlers, as stated on the solrconfig.xml comments, this could be accomplished redeclaring the query search component, however this is not working on solr 4.9.0 which is the version I’m using, this is my configuration:

    <searchComponent name="query"     class="solr.QueryComponent">
        <lst name="defaults">
            <int name="rows">1</int>
        </lst>
    </searchComponent>

The relevant portion of the solrconfig.xml comment is: "If you register a searchComponent to one of the standard names,  will be used instead of the default.” so is this a new desired behavior?? although just for testing a redefined the components of the request handler to only use the query component and not to use all the default components, this is how it looks:

<requestHandler name="/select" class="solr.SearchHandler”>
<arr name="components">
            <str>query</str>
</arr>
</requestHandler>

Everything works ok but the the rows parameter is not used, although I’m not specifying the rows parameter on the URL.

Regards,Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com

Re: Changed behavior in solr 4 ??

Posted by Jorge Luis Betancourt Gonzalez <jl...@uci.cu>.
I haven’t used it before this, basically I found out about this in the Solr in Action book and guided by the comment about redefining the default components by defining a new searchComponent with the same name. 

Any how thanks for your reply! 

Regards,

On Sep 25, 2014, at 8:01 AM, Jack Krupansky <ja...@basetechnology.com> wrote:

> I am not aware of any such feature! That doesn't mean it doesn't exist, but I don't recall seeing it in the Solr source code.
> 
> -- Jack Krupansky
> 
> -----Original Message----- From: Jorge Luis Betancourt Gonzalez
> Sent: Wednesday, September 24, 2014 1:31 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Changed behavior in solr 4 ??
> 
> Hi Jack:
> 
> Thanks for the response, yes the way you describe I know it works and is how I get it to work but then what does mean the snippet of the documentation I see on the documentation about overriding the default components shipped with Solr? Even on the book Solr in Action in chapter 7 listing 7.3 I saw something similar to what I wanted to do:
> 
> <searchComponent name="query" class="solr.QueryComponent">
> <lst name="invariants">
>   <str name="rows">25</str>
>   <str name="df">content_field</str>
> </lst>
> <lst name="defaults">
>   <str name="q">*:*</str>
>   <str name="indent">true</str>
>   <str name="echoParams">explicit</str>
> </lst>
> </searchComponent>
> Because each default search component exists by default even if it’s not defined explicitly in the solrconfig.xml file, defining them explicitly as in the previous listing will replace the default configuration.
> 
> The previous snippet is from the quoted book Solr in Action, I understand that in each SearchHandler I could define this parameters bu if defined in the searchComponent (as the book says) this configuration wouldn’t apply to all my request handlers? eliminating the need to replicate the same parameter in several parts of my solrconfig.xml (i.e all the request handlers)?
> 
> 
> Regards,
> On Sep 23, 2014, at 11:53 PM, Jack Krupansky <ja...@basetechnology.com> wrote:
> 
> 
>> You set the defaults on the "search handler", not the "search component". See solrconfig.xml:
>> 
>> <requestHandler name="/select" class="solr.SearchHandler">
>> <!-- default values for query parameters can be specified, these
>>     will be overridden by parameters in the request
>>  -->
>> <lst name="defaults">
>>   <str name="echoParams">explicit</str>
>>   <int name="rows">10</int>
>>   <str name="df">text</str>
>> </lst>
>> ...
>> 
>> -- Jack Krupansky
>> 
>> -----Original Message----- From: Jorge Luis Betancourt Gonzalez
>> Sent: Tuesday, September 23, 2014 11:02 AM
>> To: solr-user@lucene.apache.org
>> Subject: Changed behavior in solr 4 ??
>> 
>> Hi:
>> 
>> I’m trying to change the default configuration for the query component of a SearchHandler, basically I want to set a default value to the rows parameters and that this value be shared by all my SearchHandlers, as stated on the solrconfig.xml comments, this could be accomplished redeclaring the query search component, however this is not working on solr 4.9.0 which is the version I’m using, this is my configuration:
>> 
>>  <searchComponent name="query"     class="solr.QueryComponent">
>>      <lst name="defaults">
>>          <int name="rows">1</int>
>>      </lst>
>>  </searchComponent>
>> 
>> The relevant portion of the solrconfig.xml comment is: "If you register a searchComponent to one of the standard names,  will be used instead of the default.” so is this a new desired behavior?? although just for testing a redefined the components of the request handler to only use the query component and not to use all the default components, this is how it looks:
>> 
>> <requestHandler name="/select" class="solr.SearchHandler”>
>> <arr name="components">
>>          <str>query</str>
>> </arr>
>> </requestHandler>
>> 
>> Everything works ok but the the rows parameter is not used, although I’m not specifying the rows parameter on the URL.
>> 
>> Regards,Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com
> 
> 
> Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com
> 

Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com

Re: Changed behavior in solr 4 ??

Posted by Jack Krupansky <ja...@basetechnology.com>.
I am not aware of any such feature! That doesn't mean it doesn't exist, but 
I don't recall seeing it in the Solr source code.

-- Jack Krupansky

-----Original Message----- 
From: Jorge Luis Betancourt Gonzalez
Sent: Wednesday, September 24, 2014 1:31 AM
To: solr-user@lucene.apache.org
Subject: Re: Changed behavior in solr 4 ??

Hi Jack:

Thanks for the response, yes the way you describe I know it works and is how 
I get it to work but then what does mean the snippet of the documentation I 
see on the documentation about overriding the default components shipped 
with Solr? Even on the book Solr in Action in chapter 7 listing 7.3 I saw 
something similar to what I wanted to do:

<searchComponent name="query" class="solr.QueryComponent">
  <lst name="invariants">
    <str name="rows">25</str>
    <str name="df">content_field</str>
  </lst>
  <lst name="defaults">
    <str name="q">*:*</str>
    <str name="indent">true</str>
    <str name="echoParams">explicit</str>
  </lst>
</searchComponent>
Because each default search component exists by default even if it’s not 
defined explicitly in the solrconfig.xml file, defining them explicitly as 
in the previous listing will replace the default configuration.

The previous snippet is from the quoted book Solr in Action, I understand 
that in each SearchHandler I could define this parameters bu if defined in 
the searchComponent (as the book says) this configuration wouldn’t apply to 
all my request handlers? eliminating the need to replicate the same 
parameter in several parts of my solrconfig.xml (i.e all the request 
handlers)?


Regards,
On Sep 23, 2014, at 11:53 PM, Jack Krupansky <ja...@basetechnology.com> 
wrote:


> You set the defaults on the "search handler", not the "search component". 
> See solrconfig.xml:
>
> <requestHandler name="/select" class="solr.SearchHandler">
> <!-- default values for query parameters can be specified, these
>      will be overridden by parameters in the request
>   -->
>  <lst name="defaults">
>    <str name="echoParams">explicit</str>
>    <int name="rows">10</int>
>    <str name="df">text</str>
>  </lst>
> ...
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jorge Luis Betancourt Gonzalez
> Sent: Tuesday, September 23, 2014 11:02 AM
> To: solr-user@lucene.apache.org
> Subject: Changed behavior in solr 4 ??
>
> Hi:
>
> I’m trying to change the default configuration for the query component of 
> a SearchHandler, basically I want to set a default value to the rows 
> parameters and that this value be shared by all my SearchHandlers, as 
> stated on the solrconfig.xml comments, this could be accomplished 
> redeclaring the query search component, however this is not working on 
> solr 4.9.0 which is the version I’m using, this is my configuration:
>
>   <searchComponent name="query"     class="solr.QueryComponent">
>       <lst name="defaults">
>           <int name="rows">1</int>
>       </lst>
>   </searchComponent>
>
> The relevant portion of the solrconfig.xml comment is: "If you register a 
> searchComponent to one of the standard names,  will be used instead of the 
> default.” so is this a new desired behavior?? although just for testing a 
> redefined the components of the request handler to only use the query 
> component and not to use all the default components, this is how it looks:
>
> <requestHandler name="/select" class="solr.SearchHandler”>
> <arr name="components">
>           <str>query</str>
> </arr>
> </requestHandler>
>
> Everything works ok but the the rows parameter is not used, although I’m 
> not specifying the rows parameter on the URL.
>
> Regards,Concurso "Mi selfie por los 5". Detalles en 
> http://justiciaparaloscinco.wordpress.com


Concurso "Mi selfie por los 5". Detalles en 
http://justiciaparaloscinco.wordpress.com


Re: Changed behavior in solr 4 ??

Posted by Jorge Luis Betancourt Gonzalez <jl...@uci.cu>.
Don’t worry, the way Hoss explained its indeed the way I’ve know that works, but the example provided in the book pick my curiosity and hence the question in this thread.

Regards,

On Sep 30, 2014, at 5:59 PM, Timothy Potter <th...@gmail.com> wrote:

> Indeed - Hoss is correct ... it's a problem with the example in the
> book ... my apologies for the confusion!
> 
> On Tue, Sep 30, 2014 at 3:57 PM, Chris Hostetter
> <ho...@fucit.org> wrote:
>> 
>> : Thanks for the response, yes the way you describe I know it works and is
>> : how I get it to work but then what does mean the snippet of the
>> : documentation I see on the documentation about overriding the default
>> 
>> It means that there is implicitly a set of search components that have
>> default behavior, and there is an implicit list of component *names*
>> used by default by SearchHandler -- and if you override one of those
>> implicit searchComponent instances by declaring your own with the same
>> name, then it will be used by default in SerachHandler.
>> 
>> a very concrete example of this is HighlightComponent -- if you have no
>> HighlightComponent declared in your solrconfig.xml, then an implicit
>> instance exists with the name "highlight"  and SearchHandler by default
>> includes that component.
>> 
>> If you want to declare your own HighlightComponent instance with special
>> initialization logic, you can either declare it with it's own unique name,
>> and edit the "components" list on a SerachHandler declatarion to include
>> that name, or you can just name it "highlight" and it will override the
>> default instance -- this is in fact done in the example solrconfig.xml
>> (grep for "HighlightComponent")
>> 
>> : components shipped with Solr? Even on the book Solr in Action in chapter
>> : 7 listing 7.3 I saw something similar to what I wanted to do:
>> :
>> : <searchComponent name="query" class="solr.QueryComponent">
>> :   <lst name="invariants">
>>        ...
>> 
>> That appears to be a mistake in Solr in Action ... the QueryComponent
>> class does nothing with it's "init" params (the nested XML inside the
>> searchComponent declaration) so that syntax does nothing.
>> 
>> 
>> 
>> -Hoss
>> http://www.lucidworks.com/

Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com

Re: Changed behavior in solr 4 ??

Posted by Timothy Potter <th...@gmail.com>.
Indeed - Hoss is correct ... it's a problem with the example in the
book ... my apologies for the confusion!

On Tue, Sep 30, 2014 at 3:57 PM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : Thanks for the response, yes the way you describe I know it works and is
> : how I get it to work but then what does mean the snippet of the
> : documentation I see on the documentation about overriding the default
>
> It means that there is implicitly a set of search components that have
> default behavior, and there is an implicit list of component *names*
> used by default by SearchHandler -- and if you override one of those
> implicit searchComponent instances by declaring your own with the same
> name, then it will be used by default in SerachHandler.
>
> a very concrete example of this is HighlightComponent -- if you have no
> HighlightComponent declared in your solrconfig.xml, then an implicit
> instance exists with the name "highlight"  and SearchHandler by default
> includes that component.
>
> If you want to declare your own HighlightComponent instance with special
> initialization logic, you can either declare it with it's own unique name,
> and edit the "components" list on a SerachHandler declatarion to include
> that name, or you can just name it "highlight" and it will override the
> default instance -- this is in fact done in the example solrconfig.xml
> (grep for "HighlightComponent")
>
> : components shipped with Solr? Even on the book Solr in Action in chapter
> : 7 listing 7.3 I saw something similar to what I wanted to do:
> :
> : <searchComponent name="query" class="solr.QueryComponent">
> :   <lst name="invariants">
>         ...
>
> That appears to be a mistake in Solr in Action ... the QueryComponent
> class does nothing with it's "init" params (the nested XML inside the
> searchComponent declaration) so that syntax does nothing.
>
>
>
> -Hoss
> http://www.lucidworks.com/

Re: Changed behavior in solr 4 ??

Posted by Chris Hostetter <ho...@fucit.org>.
: Thanks for the response, yes the way you describe I know it works and is 
: how I get it to work but then what does mean the snippet of the 
: documentation I see on the documentation about overriding the default 

It means that there is implicitly a set of search components that have 
default behavior, and there is an implicit list of component *names* 
used by default by SearchHandler -- and if you override one of those 
implicit searchComponent instances by declaring your own with the same 
name, then it will be used by default in SerachHandler.

a very concrete example of this is HighlightComponent -- if you have no 
HighlightComponent declared in your solrconfig.xml, then an implicit 
instance exists with the name "highlight"  and SearchHandler by default 
includes that component.

If you want to declare your own HighlightComponent instance with special 
initialization logic, you can either declare it with it's own unique name, 
and edit the "components" list on a SerachHandler declatarion to include 
that name, or you can just name it "highlight" and it will override the 
default instance -- this is in fact done in the example solrconfig.xml 
(grep for "HighlightComponent")

: components shipped with Solr? Even on the book Solr in Action in chapter 
: 7 listing 7.3 I saw something similar to what I wanted to do:
: 
: <searchComponent name="query" class="solr.QueryComponent">
:   <lst name="invariants">
	...

That appears to be a mistake in Solr in Action ... the QueryComponent 
class does nothing with it's "init" params (the nested XML inside the 
searchComponent declaration) so that syntax does nothing.



-Hoss
http://www.lucidworks.com/

Re: Changed behavior in solr 4 ??

Posted by Jorge Luis Betancourt Gonzalez <jl...@uci.cu>.
Hi Jack:

Thanks for the response, yes the way you describe I know it works and is how I get it to work but then what does mean the snippet of the documentation I see on the documentation about overriding the default components shipped with Solr? Even on the book Solr in Action in chapter 7 listing 7.3 I saw something similar to what I wanted to do:

<searchComponent name="query" class="solr.QueryComponent">
  <lst name="invariants">
    <str name="rows">25</str>
    <str name="df">content_field</str>
  </lst>
  <lst name="defaults">
    <str name="q">*:*</str>
    <str name="indent">true</str>
    <str name="echoParams">explicit</str>
  </lst>
</searchComponent>
Because each default search component exists by default even if it’s not defined explicitly in the solrconfig.xml file, defining them explicitly as in the previous listing will replace the default configuration.

The previous snippet is from the quoted book Solr in Action, I understand that in each SearchHandler I could define this parameters bu if defined in the searchComponent (as the book says) this configuration wouldn’t apply to all my request handlers? eliminating the need to replicate the same parameter in several parts of my solrconfig.xml (i.e all the request handlers)?


Regards,
On Sep 23, 2014, at 11:53 PM, Jack Krupansky <ja...@basetechnology.com> wrote:


> You set the defaults on the "search handler", not the "search component". See solrconfig.xml:
> 
> <requestHandler name="/select" class="solr.SearchHandler">
> <!-- default values for query parameters can be specified, these
>      will be overridden by parameters in the request
>   -->
>  <lst name="defaults">
>    <str name="echoParams">explicit</str>
>    <int name="rows">10</int>
>    <str name="df">text</str>
>  </lst>
> ...
> 
> -- Jack Krupansky
> 
> -----Original Message----- From: Jorge Luis Betancourt Gonzalez
> Sent: Tuesday, September 23, 2014 11:02 AM
> To: solr-user@lucene.apache.org
> Subject: Changed behavior in solr 4 ??
> 
> Hi:
> 
> I’m trying to change the default configuration for the query component of a SearchHandler, basically I want to set a default value to the rows parameters and that this value be shared by all my SearchHandlers, as stated on the solrconfig.xml comments, this could be accomplished redeclaring the query search component, however this is not working on solr 4.9.0 which is the version I’m using, this is my configuration:
> 
>   <searchComponent name="query"     class="solr.QueryComponent">
>       <lst name="defaults">
>           <int name="rows">1</int>
>       </lst>
>   </searchComponent>
> 
> The relevant portion of the solrconfig.xml comment is: "If you register a searchComponent to one of the standard names,  will be used instead of the default.” so is this a new desired behavior?? although just for testing a redefined the components of the request handler to only use the query component and not to use all the default components, this is how it looks:
> 
> <requestHandler name="/select" class="solr.SearchHandler”>
> <arr name="components">
>           <str>query</str>
> </arr>
> </requestHandler>
> 
> Everything works ok but the the rows parameter is not used, although I’m not specifying the rows parameter on the URL.
> 
> Regards,Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com 


Concurso "Mi selfie por los 5". Detalles en http://justiciaparaloscinco.wordpress.com


Re: Changed behavior in solr 4 ??

Posted by Jack Krupansky <ja...@basetechnology.com>.
You set the defaults on the "search handler", not the "search component". 
See solrconfig.xml:

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
       will be overridden by parameters in the request
    -->
   <lst name="defaults">
     <str name="echoParams">explicit</str>
     <int name="rows">10</int>
     <str name="df">text</str>
   </lst>
...

-- Jack Krupansky

-----Original Message----- 
From: Jorge Luis Betancourt Gonzalez
Sent: Tuesday, September 23, 2014 11:02 AM
To: solr-user@lucene.apache.org
Subject: Changed behavior in solr 4 ??

Hi:

I’m trying to change the default configuration for the query component of a 
SearchHandler, basically I want to set a default value to the rows 
parameters and that this value be shared by all my SearchHandlers, as stated 
on the solrconfig.xml comments, this could be accomplished redeclaring the 
query search component, however this is not working on solr 4.9.0 which is 
the version I’m using, this is my configuration:

    <searchComponent name="query"     class="solr.QueryComponent">
        <lst name="defaults">
            <int name="rows">1</int>
        </lst>
    </searchComponent>

The relevant portion of the solrconfig.xml comment is: "If you register a 
searchComponent to one of the standard names,  will be used instead of the 
default.” so is this a new desired behavior?? although just for testing a 
redefined the components of the request handler to only use the query 
component and not to use all the default components, this is how it looks:

<requestHandler name="/select" class="solr.SearchHandler”>
<arr name="components">
            <str>query</str>
</arr>
</requestHandler>

Everything works ok but the the rows parameter is not used, although I’m not 
specifying the rows parameter on the URL.

Regards,Concurso "Mi selfie por los 5". Detalles en 
http://justiciaparaloscinco.wordpress.com