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 "A. Steven Anderson" <st...@asanderson.com> on 2009/07/02 21:48:20 UTC

Retrieve docs with > 1 multivalue field hits

Greetings!

I thought I remembered seeing a thread related to retrieving only documents
that had more than one hit in a particular multivalue field, but I cannot
find it now.

Regardless, is this possible in Solr 1.3? Solr 1.4?

-- 
A. Steven Anderson
Independent Consultant

Re: Retrieve docs with > 1 multivalue field hits

Posted by "A. Steven Anderson" <a....@gmail.com>.
>
> all docs that contain more than one phone number - regardless of matching a
> particular query?
>

Exactly.


> knowing that was a useful query, i'd change my indexer to also provide
> either a field with the count of phone number values, or a boolean field
> saying whether there are more than one or not.
>

True, but I was hoping there would be a generic query way to do it.


> things are more complex if you're asking something different than my
> interpretation above.
>

No. That was it.  Basically, the functional equivalent of "select * from
docs where count(phone) > 1".

I was thinking there might be a way with function queries, but I guess not.

Thanks for the answer though.

-- 
A. Steven Anderson
Independent Consultant

Re: Retrieve docs with > 1 multivalue field hits

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 9, 2009, at 5:37 PM, A. Steven Anderson wrote:
> A simple example would be if a schema included a phoneNum mulitValue  
> field
> and I wanted to return all docs that contained more than 1 phoneNum  
> field
> value.

all docs that contain more than one phone number - regardless of  
matching a particular query?

knowing that was a useful query, i'd change my indexer to also provide  
either a field with the count of phone number values, or a boolean  
field saying whether there are more than one or not.

things are more complex if you're asking something different than my  
interpretation above.

	Erik


Re: Retrieve docs with > 1 multivalue field hits

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 9, 2009, at 5:37 PM, A. Steven Anderson wrote:
> A simple example would be if a schema included a phoneNum mulitValue  
> field
> and I wanted to return all docs that contained more than 1 phoneNum  
> field
> value.

all docs that contain more than one phone number - regardless of  
matching a particular query?

knowing that was a useful query, i'd change my indexer to also provide  
either a field with the count of phone number values, or a boolean  
field saying whether there are more than one or not.

things are more complex if you're asking something different than my  
interpretation above.

	Erik


Re: Retrieve docs with > 1 multivalue field hits

Posted by "A. Steven Anderson" <st...@asanderson.com>.
>
> : I thought I remembered seeing a thread related to retrieving only
> documents
> : that had more than one hit in a particular multivalue field, but I cannot
> : find it now.
>
> not easily.
>
> for arbitrary queries there's no simple way to kow what that query matches
> a single document, multiple times, in seperate field values.
>
> there may be some tricks that are possible if you give us a more concrete
> example of what exactly your use case is.
>

Thanks for the reply. I was beginning to think it was a stupid question. ;-)


A simple example would be if a schema included a phoneNum mulitValue field
and I wanted to return all docs that contained more than 1 phoneNum field
value.

It sort of like a facet query, but only on a per document count basis.

-- 
A. Steven Anderson
Independent Consultant

Re: Retrieve docs with > 1 multivalue field hits

Posted by Chris Hostetter <ho...@fucit.org>.
: I thought I remembered seeing a thread related to retrieving only documents
: that had more than one hit in a particular multivalue field, but I cannot
: find it now.

not easily.

for arbitrary queries there's no simple way to kow what that query matches 
a single document, multiple times, in seperate field values.

there may be some tricks that are possible if you give us a more concrete 
example of what exactly your use case is.




-Hoss


Re: Retrieve docs with > 1 multivalue field hits

Posted by Otis Gospodnetic <ot...@yahoo.com>.
I don't recall seeing that mentioned at all... but my memory fails me all the time. Who's Solr?

 Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: A. Steven Anderson <st...@asanderson.com>
> To: solr-user@lucene.apache.org
> Sent: Monday, July 6, 2009 12:25:48 PM
> Subject: Re: Retrieve docs with > 1 multivalue field hits
> 
> I thought this would be a quick yes or no answer and/or reference to another
> thread, but alas, I got no replies.
> 
> Is it safe to assume the answer is 'no' for both Solr 1.3 and 1.4?
> 
> 
> On Thu, Jul 2, 2009 at 3:48 PM, A. Steven Anderson wrote:
> 
> > Greetings!
> >
> > I thought I remembered seeing a thread related to retrieving only documents
> > that had more than one hit in a particular multivalue field, but I cannot
> > find it now.
> >
> > Regardless, is this possible in Solr 1.3? Solr 1.4?
> >
> 
> -- 
> A. Steven Anderson
> Independent Consultant


Re: Retrieve docs with > 1 multivalue field hits

Posted by "A. Steven Anderson" <st...@asanderson.com>.
I thought this would be a quick yes or no answer and/or reference to another
thread, but alas, I got no replies.

Is it safe to assume the answer is 'no' for both Solr 1.3 and 1.4?


On Thu, Jul 2, 2009 at 3:48 PM, A. Steven Anderson <st...@asanderson.com>wrote:

> Greetings!
>
> I thought I remembered seeing a thread related to retrieving only documents
> that had more than one hit in a particular multivalue field, but I cannot
> find it now.
>
> Regardless, is this possible in Solr 1.3? Solr 1.4?
>

-- 
A. Steven Anderson
Independent Consultant