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 Mysurf Mail <st...@gmail.com> on 2013/07/29 17:31:25 UTC

solr - set fileds as default search field

The following query works well for me

http://[]:8983/solr/vault/select?q=VersionComments%3AWhite

returns all the documents where version comments includes White

I try to omit the field name and put it as a default value as follows : In
solr config I write

<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">PackageName</str>
   <str name="df">Tag</str>
   <str name="df">VersionComments</str>
   <str name="df">VersionTag</str>
   <str name="df">Description</str>
   <str name="df">SKU</str>
   <str name="df">SKUDesc</str>
 </lst>

I restart the solr and create a full import.
Then I try using

 http://[]:8983/solr/vault/select?q=White

(Where

 http://[]:8983/solr/vault/select?q=VersionComments%3AWhite

still works)

But I dont get the document any as answer.
What am I doing wrong?

Re: solr - set fileds as default search field

Posted by Jason Hellman <jh...@innoventsolutions.com>.
Or use the copyField technique to a single searchable field and set df= to that field.  The example schema does this with the field called "text".

On Jul 29, 2013, at 8:35 AM, Ahmet Arslan <io...@yahoo.com> wrote:

> Hi,
> 
> 
> df is a single valued parameter. Only one field can be a default field.
> 
> To query multiple fields use (e)dismax query parser : http://wiki.apache.org/solr/ExtendedDisMax#qf_.28Query_Fields.29
> 
> 
> ________________________________
> From: Mysurf Mail <st...@gmail.com>
> To: solr-user@lucene.apache.org 
> Sent: Monday, July 29, 2013 6:31 PM
> Subject: solr - set fileds as default search field
> 
> 
> The following query works well for me
> 
> http://[]:8983/solr/vault/select?q=VersionComments%3AWhite
> 
> returns all the documents where version comments includes White
> 
> I try to omit the field name and put it as a default value as follows : In
> solr config I write
> 
> <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">PackageName</str>
>    <str name="df">Tag</str>
>    <str name="df">VersionComments</str>
>    <str name="df">VersionTag</str>
>    <str name="df">Description</str>
>    <str name="df">SKU</str>
>    <str name="df">SKUDesc</str>
> </lst>
> 
> I restart the solr and create a full import.
> Then I try using
> 
> http://[]:8983/solr/vault/select?q=White
> 
> (Where
> 
> http://[]:8983/solr/vault/select?q=VersionComments%3AWhite
> 
> still works)
> 
> But I dont get the document any as answer.
> What am I doing wrong?


Re: solr - set fileds as default search field

Posted by Ahmet Arslan <io...@yahoo.com>.
Hi,


df is a single valued parameter. Only one field can be a default field.

To query multiple fields use (e)dismax query parser : http://wiki.apache.org/solr/ExtendedDisMax#qf_.28Query_Fields.29


________________________________
 From: Mysurf Mail <st...@gmail.com>
To: solr-user@lucene.apache.org 
Sent: Monday, July 29, 2013 6:31 PM
Subject: solr - set fileds as default search field
 

The following query works well for me

http://[]:8983/solr/vault/select?q=VersionComments%3AWhite

returns all the documents where version comments includes White

I try to omit the field name and put it as a default value as follows : In
solr config I write

<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">PackageName</str>
   <str name="df">Tag</str>
   <str name="df">VersionComments</str>
   <str name="df">VersionTag</str>
   <str name="df">Description</str>
   <str name="df">SKU</str>
   <str name="df">SKUDesc</str>
</lst>

I restart the solr and create a full import.
Then I try using

http://[]:8983/solr/vault/select?q=White

(Where

http://[]:8983/solr/vault/select?q=VersionComments%3AWhite

still works)

But I dont get the document any as answer.
What am I doing wrong?