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 "Abhijith Jain -X (abhijjai - DIGITAL-X INC at Cisco)" <ab...@cisco.com> on 2013/11/13 01:22:57 UTC

Modify the querySearch to q=*:*

Hello,

I upgraded Solr to 4.4.0(previous Solr version was 3.5). After the full-import was run on Solr 4.4.0 I could see the expected number of records by accessing the URL  http://myhost:7983/collection1/select/?q=*.  But when I access my application I can find partial number of records.

Later I found out that in Solr 4.4.0 query string is q=*:*. In Solr 3.5 it was q=*\*. In Solr 4.4.0 when I modified the query q=*\* I got partial number of records which is exactly the number of records I get when access my application (Attached Solr snapshots). I think my default query is set to q=*:*.

I am trying to set the query to q=*:* permanently. I tried to set q=*:* in SolrConfig.xml file as follows.

<requestHandler name="standard" class="solr.SearchHandler" default="true">
                <lst name="defaults">
                        <str name="echoParams">none</str>
                        <str name="q">*:*</str>
                </lst>
        </requestHandler>


But this didn't help. Please advise how to change query to q=*:* in Solr 4.4.


Thanks
Abhi









Re: Modify the querySearch to q=*:*

Posted by Jack Krupansky <ja...@basetechnology.com>.
Better to migrate to the 4.4 select handler conventions, as shown in the 
example schema and config, rather than mess around with the old style of 
config.

Start with the new config and schema and only add in or change things you 
really need.

But first, add the debugQuery=true parameter to see how the parameters are 
being processed.

-- Jack Krupansky

-----Original Message----- 
From: Abhijith Jain -X (abhijjai - DIGITAL-X INC at Cisco)
Sent: Tuesday, November 12, 2013 8:03 PM
To: solr-user@lucene.apache.org
Subject: RE: Modify the querySearch to q=*:*

Thanks for the quick reply. I have following lines in my SolrConfig.xml. I 
didn’t have luck with following Solrconfig.xml.





        <requestDispatcher handleSelect="true">

                <requestParsers enableRemoteStreaming="true" 
multipartUploadLimitInKB="2048000" />

        </requestDispatcher>



        <requestHandler name="standard" class="solr.SearchHandler" 
default="true">

                <lst name="defaults">

                        <str name="echoParams">none</str>

                        <str name="q">*:*</str>  <!—This is added by me -->

                </lst>

        </requestHandler>







Thanks

Abhi



-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com]
Sent: Tuesday, November 12, 2013 4:33 PM
To: solr-user@lucene.apache.org
Subject: Re: Modify the querySearch to q=*:*



Usually we use the “/select” handler now – check your solrconfig.xml and see 
if you have that as well. And check to see how “handleSelect” is set if you 
intend not to use the “/select” handler.



Overall, read the new Solr 4.4 solrconfig file carefully and try to switch 
to all of the new style of config settings.



-- Jack Krupansky



From: Abhijith Jain -X (abhijjai - DIGITAL-X INC at Cisco)

Sent: Tuesday, November 12, 2013 7:22 PM

To: solr-user@lucene.apache.org<ma...@lucene.apache.org>

Subject: Modify the querySearch to q=*:*



Hello,





I upgraded Solr to 4.4.0(previous Solr version was 3.5). After the 
full-import was run on Solr 4.4.0 I could see the expected number of records 
by accessing the URL  http://myhost:7983/collection1/select/?q=*.  But when 
I access my application I can find partial number of records.





Later I found out that in Solr 4.4.0 query string is q=*:*. In Solr 3.5 it 
was q=*\*. In Solr 4.4.0 when I modified the query q=*\* I got partial 
number of records which is exactly the number of records I get when access 
my application (Attached Solr snapshots). I think my default query is set to 
q=*:*.





I am trying to set the query to q=*:* permanently. I tried to set q=*:* in 
SolrConfig.xml file as follows.





<requestHandler name="standard" class="solr.SearchHandler" default="true">



                <lst name="defaults">



                        <str name="echoParams">none</str>



                        <str name="q">*:*</str>



                </lst>



        </requestHandler>







But this didn’t help. Please advise how to change query to q=*:* in Solr 
4.4.







Thanks



Abhi

















Re: Modify the querySearch to q=*:*

Posted by Jack Krupansky <ja...@basetechnology.com>.
Just in case anybody is curious what *\* would really mean, the backslash 
means to escape the following character, which in this case means don't 
treat the second asterisk as a wildcard, but since the initial asterisk was 
not escaped (the full rule is that if there is any unescaped wildcard in a 
term then all of the escaped wildcards are treated as unescaped since Lucene 
has no support for escaping in WildcardQuery), any escaping of wildcards in 
the term is ignored, so *\* is treated as **, and ** is redundant and 
matches the same as *, so a *\* query would simply match all documents that 
have a value in the default search field. In many cases this would give 
identical results to a *:* query, but in some apps it might not.

Still it would be nice to know who originated this suggestion to use *\* 
instead of *:* - or even simply *.

-- Jack Krupansky

-----Original Message----- 
From: Alvaro Cabrerizo
Sent: Wednesday, November 13, 2013 4:16 AM
To: solr-user@lucene.apache.org
Subject: Re: Modify the querySearch to q=*:*

Hi:

First of all I have to say that I had never heard about *\* as the query to
get all the documents in a index but *:*  (maybe I'm wrong) . Re-reading
"Apache Solr 4 cookbook", "Solr 1.4 Enterprise Search Server" and " Apache
Solr 3 Enterprise Search Server" there is no trace for the query *\* as the
universal query to get every doc.

If you enable 
debugQuery<http://wiki.apache.org/solr/CommonQueryParameters#debugQuery>
you
can see that *:* is transformed into "MatchAllDocsQuery(*:*) (Solr1.4 and
Solr4.4) wich means give me all the documents, but the query *\* is
transformed into other thing (In my case having a default field called
description defined in the schema) I get in Solr1.4 description:*\\* wich
means give all the documents that have the char \ in the field description
and in SOLR1.4  I get description:** which also gets all the documents in
the index. It would be helpful to see how is interpreted *\* in your system
(solr3.5 and solr4).

I think, the best way to solve your problem Is to modify the system which
launches the request to SOLR and modify *\* by *:* (if it is possible). I
dont know if SOLR can make that kind of translation, I mean change *\* by
*:*.  One possible workaround with collateral damages is the inclusion of a
PatternReplaceCharFilterFactory (in schema.xml) within the fieldtypes you
use to search in order to delete every \ character included in the input or
even include the expression to transform *\* into *:* . But including that
element in your schema means that it will always be used during your search
(thus if your users type a\b they will search ab). If you want to explore
that path I recommend you to use the analysis
tool<https://cwiki.apache.org/confluence/display/solr/Analysis+Screen>included
in solr.

Regards.













On Wed, Nov 13, 2013 at 2:34 AM, Shawn Heisey <so...@elyograg.org> wrote:

> On 11/12/2013 6:03 PM, Abhijith Jain -X (abhijjai - DIGITAL-X INC at
> Cisco) wrote:
>
>> I am trying to set the query to q=*:* permanently. I tried to set q=*:*
>> in SolrConfig.xml file as follows.
>>
>> <requestHandler name="standard" class="solr.SearchHandler" 
>> default="true">
>>                  <lst name="defaults">
>>                          <str name="echoParams">none</str>
>>                          <str name="q">*:*</str>
>>                  </lst>
>>          </requestHandler>
>>
>> But this didn’t help. Please advise how to change query to q=*:* in Solr
>> 4.4.
>>
>
> This configuration sets the default for the q parameter to *:*, but if the
> actual query that is sent to Solr has a q parameter, it will override that
> default.
>
> In the very unlikely situation that you don't want to ever do any query
> besides *:*, you can put that setting into the invariants section instead
> of the defaults section - but be aware that if you do that, you will never
> be able to send any other query.Normally your application decides what the
> query string should be, not Solr.
>
> I concur with Jack's recommendation that you migrate to the 4.x way of
> naming handlers.  You would need to set handleSelect to false and change
> all your search handlers so their name starts with a slash.  The one that
> is currently named "standard" would instead be named "/select" and you
> would need to remove the default="true" setting.
>
> Thanks,
> Shawn
>
> 


Re: Modify the querySearch to q=*:*

Posted by Alvaro Cabrerizo <to...@gmail.com>.
Hi:

First of all I have to say that I had never heard about *\* as the query to
get all the documents in a index but *:*  (maybe I'm wrong) . Re-reading
"Apache Solr 4 cookbook", "Solr 1.4 Enterprise Search Server" and " Apache
Solr 3 Enterprise Search Server" there is no trace for the query *\* as the
universal query to get every doc.

If you enable debugQuery<http://wiki.apache.org/solr/CommonQueryParameters#debugQuery>
you
can see that *:* is transformed into "MatchAllDocsQuery(*:*) (Solr1.4 and
Solr4.4) wich means give me all the documents, but the query *\* is
transformed into other thing (In my case having a default field called
description defined in the schema) I get in Solr1.4 description:*\\* wich
means give all the documents that have the char \ in the field description
and in SOLR1.4  I get description:** which also gets all the documents in
the index. It would be helpful to see how is interpreted *\* in your system
(solr3.5 and solr4).

I think, the best way to solve your problem Is to modify the system which
launches the request to SOLR and modify *\* by *:* (if it is possible). I
dont know if SOLR can make that kind of translation, I mean change *\* by
*:*.  One possible workaround with collateral damages is the inclusion of a
PatternReplaceCharFilterFactory (in schema.xml) within the fieldtypes you
use to search in order to delete every \ character included in the input or
even include the expression to transform *\* into *:* . But including that
element in your schema means that it will always be used during your search
(thus if your users type a\b they will search ab). If you want to explore
that path I recommend you to use the analysis
tool<https://cwiki.apache.org/confluence/display/solr/Analysis+Screen>included
in solr.

Regards.













On Wed, Nov 13, 2013 at 2:34 AM, Shawn Heisey <so...@elyograg.org> wrote:

> On 11/12/2013 6:03 PM, Abhijith Jain -X (abhijjai - DIGITAL-X INC at
> Cisco) wrote:
>
>> I am trying to set the query to q=*:* permanently. I tried to set q=*:*
>> in SolrConfig.xml file as follows.
>>
>> <requestHandler name="standard" class="solr.SearchHandler" default="true">
>>                  <lst name="defaults">
>>                          <str name="echoParams">none</str>
>>                          <str name="q">*:*</str>
>>                  </lst>
>>          </requestHandler>
>>
>> But this didn’t help. Please advise how to change query to q=*:* in Solr
>> 4.4.
>>
>
> This configuration sets the default for the q parameter to *:*, but if the
> actual query that is sent to Solr has a q parameter, it will override that
> default.
>
> In the very unlikely situation that you don't want to ever do any query
> besides *:*, you can put that setting into the invariants section instead
> of the defaults section - but be aware that if you do that, you will never
> be able to send any other query.Normally your application decides what the
> query string should be, not Solr.
>
> I concur with Jack's recommendation that you migrate to the 4.x way of
> naming handlers.  You would need to set handleSelect to false and change
> all your search handlers so their name starts with a slash.  The one that
> is currently named "standard" would instead be named "/select" and you
> would need to remove the default="true" setting.
>
> Thanks,
> Shawn
>
>

Re: Modify the querySearch to q=*:*

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/12/2013 6:03 PM, Abhijith Jain -X (abhijjai - DIGITAL-X INC at 
Cisco) wrote:
> I am trying to set the query to q=*:* permanently. I tried to set q=*:* in SolrConfig.xml file as follows.
>
> <requestHandler name="standard" class="solr.SearchHandler" default="true">
>                  <lst name="defaults">
>                          <str name="echoParams">none</str>
>                          <str name="q">*:*</str>
>                  </lst>
>          </requestHandler>
>
> But this didn’t help. Please advise how to change query to q=*:* in Solr 4.4.

This configuration sets the default for the q parameter to *:*, but if 
the actual query that is sent to Solr has a q parameter, it will 
override that default.

In the very unlikely situation that you don't want to ever do any query 
besides *:*, you can put that setting into the invariants section 
instead of the defaults section - but be aware that if you do that, you 
will never be able to send any other query.Normally your application 
decides what the query string should be, not Solr.

I concur with Jack's recommendation that you migrate to the 4.x way of 
naming handlers.  You would need to set handleSelect to false and change 
all your search handlers so their name starts with a slash.  The one 
that is currently named "standard" would instead be named "/select" and 
you would need to remove the default="true" setting.

Thanks,
Shawn


RE: Modify the querySearch to q=*:*

Posted by "Abhijith Jain -X (abhijjai - DIGITAL-X INC at Cisco)" <ab...@cisco.com>.
Thanks for the quick reply. I have following lines in my SolrConfig.xml. I didn’t have luck with following Solrconfig.xml.





        <requestDispatcher handleSelect="true">

                <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />

        </requestDispatcher>



        <requestHandler name="standard" class="solr.SearchHandler" default="true">

                <lst name="defaults">

                        <str name="echoParams">none</str>

                        <str name="q">*:*</str>  <!—This is added by me -->

                </lst>

        </requestHandler>







Thanks

Abhi



-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com]
Sent: Tuesday, November 12, 2013 4:33 PM
To: solr-user@lucene.apache.org
Subject: Re: Modify the querySearch to q=*:*



Usually we use the “/select” handler now – check your solrconfig.xml and see if you have that as well. And check to see how “handleSelect” is set if you intend not to use the “/select” handler.



Overall, read the new Solr 4.4 solrconfig file carefully and try to switch to all of the new style of config settings.



-- Jack Krupansky



From: Abhijith Jain -X (abhijjai - DIGITAL-X INC at Cisco)

Sent: Tuesday, November 12, 2013 7:22 PM

To: solr-user@lucene.apache.org<ma...@lucene.apache.org>

Subject: Modify the querySearch to q=*:*



Hello,





I upgraded Solr to 4.4.0(previous Solr version was 3.5). After the full-import was run on Solr 4.4.0 I could see the expected number of records by accessing the URL  http://myhost:7983/collection1/select/?q=*.  But when I access my application I can find partial number of records.





Later I found out that in Solr 4.4.0 query string is q=*:*. In Solr 3.5 it was q=*\*. In Solr 4.4.0 when I modified the query q=*\* I got partial number of records which is exactly the number of records I get when access my application (Attached Solr snapshots). I think my default query is set to q=*:*.





I am trying to set the query to q=*:* permanently. I tried to set q=*:* in SolrConfig.xml file as follows.





<requestHandler name="standard" class="solr.SearchHandler" default="true">



                <lst name="defaults">



                        <str name="echoParams">none</str>



                        <str name="q">*:*</str>



                </lst>



        </requestHandler>







But this didn’t help. Please advise how to change query to q=*:* in Solr 4.4.







Thanks



Abhi

















Re: Modify the querySearch to q=*:*

Posted by Jack Krupansky <ja...@basetechnology.com>.
Usually we use the “/select” handler now – check your solrconfig.xml and see if you have that as well. And check to see how “handleSelect” is set if you intend not to use the “/select” handler.

Overall, read the new Solr 4.4 solrconfig file carefully and try to switch to all of the new style of config settings.

-- Jack Krupansky

From: Abhijith Jain -X (abhijjai - DIGITAL-X INC at Cisco) 
Sent: Tuesday, November 12, 2013 7:22 PM
To: solr-user@lucene.apache.org 
Subject: Modify the querySearch to q=*:* 

Hello,

 

I upgraded Solr to 4.4.0(previous Solr version was 3.5). After the full-import was run on Solr 4.4.0 I could see the expected number of records by accessing the URL  http://myhost:7983/collection1/select/?q=*.  But when I access my application I can find partial number of records. 

 

Later I found out that in Solr 4.4.0 query string is q=*:*. In Solr 3.5 it was q=*\*. In Solr 4.4.0 when I modified the query q=*\* I got partial number of records which is exactly the number of records I get when access my application (Attached Solr snapshots). I think my default query is set to q=*:*. 

 

I am trying to set the query to q=*:* permanently. I tried to set q=*:* in SolrConfig.xml file as follows.

 

<requestHandler name="standard" class="solr.SearchHandler" default="true">

                <lst name="defaults">

                        <str name="echoParams">none</str>

                        <str name="q">*:*</str>

                </lst>

        </requestHandler>

 

 

But this didn’t help. Please advise how to change query to q=*:* in Solr 4.4.

 

 

Thanks

Abhi