You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Patrick Bernardina <pa...@gmail.com> on 2022/06/23 12:03:25 UTC

Multi-Value query test

How to test if a value in a multi-value field matches a specific query?

Example of the problem:

I've created a query to return all documents of some specific authors. The
authors field contains multi-value sorted set.
When showing the result, I want to show only the name of the authors
specified on the query, even if the document has more authors.

Re: Multi-Value query test

Posted by Patrick Bernardina <pa...@gmail.com>.
Let me clarify:
Example query: "(author:Patrick author:Michael) && type:pdf"
Example result: 2 items: Doc1 with authors "Patrick, Adalberto" and Doc2
with authors "Patrick, Michael, Elias"

I want to show the 2 items, but when I show the authors, I only want to
show the authors that are in the query also:
Doc1 - Patrick
Doc1 - Patrick, Michael

So, I need to test each author value if is valid for the same query used
for the resultSet.



Il giorno gio 23 giu 2022 alle ore 08:08 Michael Wechner <
michael.wechner@wyona.com> ha scritto:

> Maybe I misunderstand the problem, but why don't you decouple showing
> the results from the results of the query?
>
> Am 23.06.22 um 14:03 schrieb Patrick Bernardina:
> > How to test if a value in a multi-value field matches a specific query?
> >
> > Example of the problem:
> >
> > I've created a query to return all documents of some specific authors.
> The
> > authors field contains multi-value sorted set.
> > When showing the result, I want to show only the name of the authors
> > specified on the query, even if the document has more authors.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Multi-Value query test

Posted by Michael Wechner <mi...@wyona.com>.
Maybe I misunderstand the problem, but why don't you decouple showing 
the results from the results of the query?

Am 23.06.22 um 14:03 schrieb Patrick Bernardina:
> How to test if a value in a multi-value field matches a specific query?
>
> Example of the problem:
>
> I've created a query to return all documents of some specific authors. The
> authors field contains multi-value sorted set.
> When showing the result, I want to show only the name of the authors
> specified on the query, even if the document has more authors.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org