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 Trilok Prithvi <tr...@gmail.com> on 2015/01/30 01:46:20 UTC
Key/Value Query
Hi,
I need your help on the following query:
*Indexed data (field name is 'text'):*
*------------------------------------------------*
*I'm also a cat*
*I'm pig*
*I'm a cat*
*I'm a hero*
*I'm a superman*
*I'm dog*
I want to query for *text:(i'm cat) OR text:(i'm dog) OR text:(i'm god)*
And I would like to get the result set as follows in a *single query*:
*i'm cat => I'm a cat*
*i'm dog => I'm dog*
*i'm god => <null or empty string>*
Currently, I'm firing 3 individual queries, each one for "i'm dog", "i'm
cat", "i'm god" with rows=1 to get the best result on the top and
programatically, building the result set.
Question is, how do we fire this in one query (to make it faster, than
making multiple calls) and get the result in a similar format? If the
question is vague, please let me know and I would be happy to clarify.
Thanks
Trilok
Re: Key/Value Query
Posted by Alexandre Rafalovitch <ar...@gmail.com>.
That's a bit hard. I think some of this information is in the debug,
if you enable it. But that's expensive.
You don't by any chance trying to run incoming documents against a
bunch of preset queries, do you? Because if you do, Luwak might be
something to check out. https://github.com/flaxsearch/luwak And one
day, it might be in Solr
Regards,
Alex.
----
Sign up for my Solr resources newsletter at http://www.solr-start.com/
On 29 January 2015 at 19:46, Trilok Prithvi <tr...@gmail.com> wrote:
> Hi,
>
> I need your help on the following query:
>
> *Indexed data (field name is 'text'):*
> *------------------------------------------------*
> *I'm also a cat*
> *I'm pig*
> *I'm a cat*
> *I'm a hero*
> *I'm a superman*
> *I'm dog*
>
> I want to query for *text:(i'm cat) OR text:(i'm dog) OR text:(i'm god)*
>
> And I would like to get the result set as follows in a *single query*:
> *i'm cat => I'm a cat*
> *i'm dog => I'm dog*
> *i'm god => <null or empty string>*
>
> Currently, I'm firing 3 individual queries, each one for "i'm dog", "i'm
> cat", "i'm god" with rows=1 to get the best result on the top and
> programatically, building the result set.
>
> Question is, how do we fire this in one query (to make it faster, than
> making multiple calls) and get the result in a similar format? If the
> question is vague, please let me know and I would be happy to clarify.
>
> Thanks
> Trilok