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 Darren Govoni <da...@ontrenet.com> on 2011/08/25 18:11:58 UTC

Paging over mutlivalued field results?

Hi,
   Is it possible to construct a query in Solr where the paged results are
matching multivalued fields and not documents?

thanks,
Darren

Re: Paging over mutlivalued field results?

Posted by da...@ontrenet.com.
Yeah, I've resigned that this is the most practical workaround.
But it also means a 100-1 explosion in my index size. For every book
document,
there will now be a 100 (for example) sentence documents from it.

What's the best way to submit a feature request for Solr?

Many thanks.

On Fri, 26 Aug 2011 09:36:51 -0400, Erik Hatcher <er...@gmail.com>
wrote:
> The way folks have addressed this situation to date is to model the
> "multivalued fields" as additional documents too.
> 
> 
> On Aug 26, 2011, at 09:32 , <da...@ontrenet.com> <da...@ontrenet.com>
> wrote:
> 
>> 
>> Many thanks Erick.
>> 
>> I think a good feature to add to Solr to address this is
>> to allow a query to return either the "document" as a result
>> or the matching (multivalued) fields of a document as individual
results
>> (subject to paging too).
>> Because sometimes the field value (only) is the desired result list.
>> 
>> Since Solr already touches the index for the field match and paging,
>> all the logic is already there to return only the field results (and
some
>> document metadata perhaps).
>> 
>> I will ponder a way to do this with a query handler maybe.
>> 
>> On Fri, 26 Aug 2011 09:09:06 -0400, Erick Erickson
>> <er...@gmail.com> wrote:
>>> OK, I think I have it.
>>> 
>>> It's a problem, indeed. And no, there's no way I know of to
>>> make a doc fetch only bring back some range of values in
>>> a multivalued field.
>>> 
>>> So you're stuck with either getting the whole book back
>>> and peeling out the pages (how do you know which
>>> sentences are on which page anyway?) or breaking
>>> your book up somehow, say on a chapter or page basis
>>> to reduce what's returned. You could possibly group
>>> the results by book if you broke it up..
>>> 
>>> BTW, you can match within sentences by appropriate
>>> proximity searches combined with an incrementgap.
>>> 
>>> Best
>>> Erick
>>> 
>>> On Thu, Aug 25, 2011 at 10:01 PM, Darren Govoni <da...@ontrenet.com>
>>> wrote:
>>>> Hi Erick,
>>>>   Sure thing.
>>>> 
>>>> I have a document schema where I put the sentences of that document
in
>> a
>>>> multivalued field "sentences".
>>>> I search that field in a query but get back the document results,
>>>> naturally.
>>>> 
>>>> I then need to further find which exact sentences matched the query
>> (for
>>>> each document result)
>>>> and then do my own paging since I am only returning pages of
sentences
>>>> and
>>>> not the whole document.
>>>> (i.e. I don't want to page the document results).
>>>> 
>>>> Does this make sense? Or is there a better way Solr can accomodate
>> this?
>>>> 
>>>> Much appreciated.
>>>> 
>>>> Darren
>>>> 
>>>> On 08/25/2011 07:24 PM, Erick Erickson wrote:
>>>>> 
>>>>> Hmm, I don't quite understand what you want. An example
>>>>> or two would help.
>>>>> 
>>>>> Best
>>>>> Erick
>>>>> 
>>>>> On Thu, Aug 25, 2011 at 12:11 PM, Darren Govoni<da...@ontrenet.com>
>>>>>  wrote:
>>>>>> 
>>>>>> Hi,
>>>>>>  Is it possible to construct a query in Solr where the paged
results
>>>>>> are
>>>>>> matching multivalued fields and not documents?
>>>>>> 
>>>>>> thanks,
>>>>>> Darren
>>>>>> 
>>>> 
>>>>

Re: Paging over mutlivalued field results?

Posted by Erik Hatcher <er...@gmail.com>.
The way folks have addressed this situation to date is to model the "multivalued fields" as additional documents too.


On Aug 26, 2011, at 09:32 , <da...@ontrenet.com> <da...@ontrenet.com> wrote:

> 
> Many thanks Erick.
> 
> I think a good feature to add to Solr to address this is
> to allow a query to return either the "document" as a result
> or the matching (multivalued) fields of a document as individual results
> (subject to paging too).
> Because sometimes the field value (only) is the desired result list.
> 
> Since Solr already touches the index for the field match and paging,
> all the logic is already there to return only the field results (and some
> document metadata perhaps).
> 
> I will ponder a way to do this with a query handler maybe.
> 
> On Fri, 26 Aug 2011 09:09:06 -0400, Erick Erickson
> <er...@gmail.com> wrote:
>> OK, I think I have it.
>> 
>> It's a problem, indeed. And no, there's no way I know of to
>> make a doc fetch only bring back some range of values in
>> a multivalued field.
>> 
>> So you're stuck with either getting the whole book back
>> and peeling out the pages (how do you know which
>> sentences are on which page anyway?) or breaking
>> your book up somehow, say on a chapter or page basis
>> to reduce what's returned. You could possibly group
>> the results by book if you broke it up..
>> 
>> BTW, you can match within sentences by appropriate
>> proximity searches combined with an incrementgap.
>> 
>> Best
>> Erick
>> 
>> On Thu, Aug 25, 2011 at 10:01 PM, Darren Govoni <da...@ontrenet.com>
>> wrote:
>>> Hi Erick,
>>>   Sure thing.
>>> 
>>> I have a document schema where I put the sentences of that document in
> a
>>> multivalued field "sentences".
>>> I search that field in a query but get back the document results,
>>> naturally.
>>> 
>>> I then need to further find which exact sentences matched the query
> (for
>>> each document result)
>>> and then do my own paging since I am only returning pages of sentences
>>> and
>>> not the whole document.
>>> (i.e. I don't want to page the document results).
>>> 
>>> Does this make sense? Or is there a better way Solr can accomodate
> this?
>>> 
>>> Much appreciated.
>>> 
>>> Darren
>>> 
>>> On 08/25/2011 07:24 PM, Erick Erickson wrote:
>>>> 
>>>> Hmm, I don't quite understand what you want. An example
>>>> or two would help.
>>>> 
>>>> Best
>>>> Erick
>>>> 
>>>> On Thu, Aug 25, 2011 at 12:11 PM, Darren Govoni<da...@ontrenet.com>
>>>>  wrote:
>>>>> 
>>>>> Hi,
>>>>>  Is it possible to construct a query in Solr where the paged results
>>>>> are
>>>>> matching multivalued fields and not documents?
>>>>> 
>>>>> thanks,
>>>>> Darren
>>>>> 
>>> 
>>> 


Re: Paging over mutlivalued field results?

Posted by da...@ontrenet.com.
Many thanks Erick.

I think a good feature to add to Solr to address this is
to allow a query to return either the "document" as a result
or the matching (multivalued) fields of a document as individual results
(subject to paging too).
Because sometimes the field value (only) is the desired result list.

Since Solr already touches the index for the field match and paging,
all the logic is already there to return only the field results (and some
document metadata perhaps).

I will ponder a way to do this with a query handler maybe.

On Fri, 26 Aug 2011 09:09:06 -0400, Erick Erickson
<er...@gmail.com> wrote:
> OK, I think I have it.
> 
> It's a problem, indeed. And no, there's no way I know of to
> make a doc fetch only bring back some range of values in
> a multivalued field.
> 
> So you're stuck with either getting the whole book back
> and peeling out the pages (how do you know which
> sentences are on which page anyway?) or breaking
> your book up somehow, say on a chapter or page basis
> to reduce what's returned. You could possibly group
> the results by book if you broke it up..
> 
> BTW, you can match within sentences by appropriate
> proximity searches combined with an incrementgap.
> 
> Best
> Erick
> 
> On Thu, Aug 25, 2011 at 10:01 PM, Darren Govoni <da...@ontrenet.com>
> wrote:
>> Hi Erick,
>>   Sure thing.
>>
>> I have a document schema where I put the sentences of that document in
a
>> multivalued field "sentences".
>> I search that field in a query but get back the document results,
>> naturally.
>>
>> I then need to further find which exact sentences matched the query
(for
>> each document result)
>> and then do my own paging since I am only returning pages of sentences
>> and
>> not the whole document.
>> (i.e. I don't want to page the document results).
>>
>> Does this make sense? Or is there a better way Solr can accomodate
this?
>>
>> Much appreciated.
>>
>> Darren
>>
>> On 08/25/2011 07:24 PM, Erick Erickson wrote:
>>>
>>> Hmm, I don't quite understand what you want. An example
>>> or two would help.
>>>
>>> Best
>>> Erick
>>>
>>> On Thu, Aug 25, 2011 at 12:11 PM, Darren Govoni<da...@ontrenet.com>
>>>  wrote:
>>>>
>>>> Hi,
>>>>  Is it possible to construct a query in Solr where the paged results
>>>> are
>>>> matching multivalued fields and not documents?
>>>>
>>>> thanks,
>>>> Darren
>>>>
>>
>>

Re: Paging over mutlivalued field results?

Posted by Erick Erickson <er...@gmail.com>.
OK, I think I have it.

It's a problem, indeed. And no, there's no way I know of to
make a doc fetch only bring back some range of values in
a multivalued field.

So you're stuck with either getting the whole book back
and peeling out the pages (how do you know which
sentences are on which page anyway?) or breaking
your book up somehow, say on a chapter or page basis
to reduce what's returned. You could possibly group
the results by book if you broke it up..

BTW, you can match within sentences by appropriate
proximity searches combined with an incrementgap.

Best
Erick

On Thu, Aug 25, 2011 at 10:01 PM, Darren Govoni <da...@ontrenet.com> wrote:
> Hi Erick,
>   Sure thing.
>
> I have a document schema where I put the sentences of that document in a
> multivalued field "sentences".
> I search that field in a query but get back the document results, naturally.
>
> I then need to further find which exact sentences matched the query (for
> each document result)
> and then do my own paging since I am only returning pages of sentences and
> not the whole document.
> (i.e. I don't want to page the document results).
>
> Does this make sense? Or is there a better way Solr can accomodate this?
>
> Much appreciated.
>
> Darren
>
> On 08/25/2011 07:24 PM, Erick Erickson wrote:
>>
>> Hmm, I don't quite understand what you want. An example
>> or two would help.
>>
>> Best
>> Erick
>>
>> On Thu, Aug 25, 2011 at 12:11 PM, Darren Govoni<da...@ontrenet.com>
>>  wrote:
>>>
>>> Hi,
>>>  Is it possible to construct a query in Solr where the paged results are
>>> matching multivalued fields and not documents?
>>>
>>> thanks,
>>> Darren
>>>
>
>

Re: Paging over mutlivalued field results?

Posted by Darren Govoni <da...@ontrenet.com>.
Hi Erick,
    Sure thing.

I have a document schema where I put the sentences of that document in a 
multivalued field "sentences".
I search that field in a query but get back the document results, naturally.

I then need to further find which exact sentences matched the query (for 
each document result)
and then do my own paging since I am only returning pages of sentences 
and not the whole document.
(i.e. I don't want to page the document results).

Does this make sense? Or is there a better way Solr can accomodate this?

Much appreciated.

Darren

On 08/25/2011 07:24 PM, Erick Erickson wrote:
> Hmm, I don't quite understand what you want. An example
> or two would help.
>
> Best
> Erick
>
> On Thu, Aug 25, 2011 at 12:11 PM, Darren Govoni<da...@ontrenet.com>  wrote:
>> Hi,
>>   Is it possible to construct a query in Solr where the paged results are
>> matching multivalued fields and not documents?
>>
>> thanks,
>> Darren
>>


Re: Paging over mutlivalued field results?

Posted by Erick Erickson <er...@gmail.com>.
Hmm, I don't quite understand what you want. An example
or two would help.

Best
Erick

On Thu, Aug 25, 2011 at 12:11 PM, Darren Govoni <da...@ontrenet.com> wrote:
> Hi,
>  Is it possible to construct a query in Solr where the paged results are
> matching multivalued fields and not documents?
>
> thanks,
> Darren
>