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 Senthilnathan Vijayaraja <se...@8kmiles.com> on 2013/12/17 13:55:48 UTC

Fallback Local Requests

Hi,

my query format is,

q=(price_min:[100000 TO 800000] OR price_max:[100000 TO 800000])AND
(size_min:[1000 TO 5000] OR size_max:[1000 TO 5000])....

  if this query returns 0 results then
    -->fire a fallback query after changing the value of size_min and
size_max
        q=(price_min:[100000 TO 800000] OR price_max:[100000 TO 800000])AND
(size_min:[100 TO 500] OR size_max:[100 TO 500])
  if, again it gives 0 results then
    -->fire a fallback query after changing the value of price_min and
price_max
        q=(price_min:[1000 TO 8000] OR price_max:[1000 TO 8000])AND
(size_min:[100 TO 500] OR size_max:[100 TO 500])

        I wrote a custom request handler to achieve this and now it is
working fine but in my code,

        I got the value of 'q' param like,

        String[] paramVals = reqParams.getParams("q");//(price_min:[100000
TO 800000] OR price_max:[100000 TO 800000])AND (size_min:[1000 TO 5000] OR
size_max:[1000 TO 5000])

        and  manually replaced the price_min,price_max,size_min,size_max
values using string functions,there by I formed two LocalRequests for
handling  this.


Is there any better way to handle this,I want this to be more
configurable..???





Thanks & Regards,
Senthilnathan V

Re: Fallback Local Requests

Posted by Senthilnathan Vijayaraja <se...@8kmiles.com>.
Hi Ahmet,

     It seems like it will bring more complexity than what I did. But of
course it is easily customizable.Worthy alternate approach to think
of.Thanks.

Thanks & Regards,
Senthilnathan v


Thanks & Regards,
Senthilnathan V


On Tue, Dec 17, 2013 at 6:44 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> Hi Senthilnathan,
>
> I not 100% sure but I https://issues.apache.org/jira/browse/SOLR-5005could be used such cases.
>
>
>
>
>
> On Tuesday, December 17, 2013 2:56 PM, Senthilnathan Vijayaraja <
> senthilnathan@8kmiles.com> wrote:
> Hi,
>
> my query format is,
>
> q=(price_min:[100000 TO 800000] OR price_max:[100000 TO 800000])AND
> (size_min:[1000 TO 5000] OR size_max:[1000 TO 5000])....
>
>   if this query returns 0 results then
>     -->fire a fallback query after changing the value of size_min and
> size_max
>         q=(price_min:[100000 TO 800000] OR price_max:[100000 TO 800000])AND
> (size_min:[100 TO 500] OR size_max:[100 TO 500])
>   if, again it gives 0 results then
>     -->fire a fallback query after changing the value of price_min and
> price_max
>         q=(price_min:[1000 TO 8000] OR price_max:[1000 TO 8000])AND
> (size_min:[100 TO 500] OR size_max:[100 TO 500])
>
>         I wrote a custom request handler to achieve this and now it is
> working fine but in my code,
>
>         I got the value of 'q' param like,
>
>         String[] paramVals = reqParams.getParams("q");//(price_min:[100000
> TO 800000] OR price_max:[100000 TO 800000])AND (size_min:[1000 TO 5000] OR
> size_max:[1000 TO 5000])
>
>         and  manually replaced the price_min,price_max,size_min,size_max
> values using string functions,there by I formed two LocalRequests for
> handling  this.
>
>
> Is there any better way to handle this,I want this to be more
> configurable..???
>
>
>
>
>
> Thanks & Regards,
> Senthilnathan V
>
>

Re: Fallback Local Requests

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

I not 100% sure but I https://issues.apache.org/jira/browse/SOLR-5005 could be used such cases.





On Tuesday, December 17, 2013 2:56 PM, Senthilnathan Vijayaraja <se...@8kmiles.com> wrote:
Hi,

my query format is,

q=(price_min:[100000 TO 800000] OR price_max:[100000 TO 800000])AND
(size_min:[1000 TO 5000] OR size_max:[1000 TO 5000])....

  if this query returns 0 results then
    -->fire a fallback query after changing the value of size_min and
size_max
        q=(price_min:[100000 TO 800000] OR price_max:[100000 TO 800000])AND
(size_min:[100 TO 500] OR size_max:[100 TO 500])
  if, again it gives 0 results then
    -->fire a fallback query after changing the value of price_min and
price_max
        q=(price_min:[1000 TO 8000] OR price_max:[1000 TO 8000])AND
(size_min:[100 TO 500] OR size_max:[100 TO 500])

        I wrote a custom request handler to achieve this and now it is
working fine but in my code,

        I got the value of 'q' param like,

        String[] paramVals = reqParams.getParams("q");//(price_min:[100000
TO 800000] OR price_max:[100000 TO 800000])AND (size_min:[1000 TO 5000] OR
size_max:[1000 TO 5000])

        and  manually replaced the price_min,price_max,size_min,size_max
values using string functions,there by I formed two LocalRequests for
handling  this.


Is there any better way to handle this,I want this to be more
configurable..???





Thanks & Regards,
Senthilnathan V


Re: Fallback Local Requests

Posted by Senthilnathan Vijayaraja <se...@8kmiles.com>.
Hoss..

--> I strongly advise anyone who asks me 99% of the time "fall back" queries
     for 0 results found are a really bad idea, because they can easily
create
     very strange user experiences.

yes, I do agree it will create strange user experience in most of the
cases.But in my case I need to show some results that is closely related to
the user instead of saying "no results found".

for Eg. user may be looking for the mobile-phone costs below $5000,white
color,samsung,jelly bean,etc..

I have mobile-phones with all these specification but price is
$5005.Instead of giving 0 result I want to show this.I cannot go back and
ask for the requirement change.

thanks for the useful links.

Thanks & Regards,
Senthilnathan v


Thanks & Regards,
Senthilnathan V


On Tue, Dec 17, 2013 at 9:28 PM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> : Subject: Fallback Local Requests
>
>         ...
>
> :   if this query returns 0 results then
> :     -->fire a fallback query after changing the value of size_min and
> : size_max
>
> I strongly advise anyone who asks me 99% of the time "fall back" queries
> for 0 results found are a really bad idea, because they can easily create
> very strange user experiences.
>
> Check out slide #11, the "Fallback" example ~ 14:50 ...
>
> https://people.apache.org/~hossman/ac2012eu/#slide11
> http://vimeopro.com/user11514798/apache-lucene-eurocon-2012/video/55822630
>
> ...watch the whole video for an in depth discussion on how to take
> advantage of domain knowledge to *boost* documents based on important
> criteria so they score higher instead of using sledgehammers like fallback
> queries.
>
>
> -Hoss
> http://www.lucidworks.com/
>

Re: Fallback Local Requests

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Fallback Local Requests

	...

:   if this query returns 0 results then
:     -->fire a fallback query after changing the value of size_min and
: size_max

I strongly advise anyone who asks me 99% of the time "fall back" queries 
for 0 results found are a really bad idea, because they can easily create 
very strange user experiences.  

Check out slide #11, the "Fallback" example ~ 14:50 ...

https://people.apache.org/~hossman/ac2012eu/#slide11
http://vimeopro.com/user11514798/apache-lucene-eurocon-2012/video/55822630

...watch the whole video for an in depth discussion on how to take 
advantage of domain knowledge to *boost* documents based on important 
criteria so they score higher instead of using sledgehammers like fallback 
queries.


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