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 <j...@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

Reply via email to