Mailing List Archive

Exact match syntax
Lucene has been working well for us until the last few days when we hit a
snag.


We're trying to build a query to search a multiple value property to see if
it contains the value of AUDIO. However there is also a different value for
that property called AUDIO_SLIDESHOW. Documents with AUDIO_SLIDESHOW but not
AUDIO should NOT get returned by this query.



Just to make it more complicated it is possible a document has both an AUDIO
value AND an AUDIO_SLIDESHOW value for that property. In this case the
document should be returned.

So this property could be
property:AUDIO (RETURNED)
property:AUDIO_SLIDESHOW (NOT RETURNED)
property:AUDIO, AUDIO_SLIDESHOW (RETURNED)


Can anyone think of a query syntax that will allow us to get all documents
with AUDIO in that property but not AUDIO_SLIDESHOW?

Is it possible to build a generic query to do this or do I need to do some
java programming?

Any advice would be great
Thanks
--
View this message in context: http://www.nabble.com/Exact-match-syntax-tp14930762p14930762.html
Sent from the Lucene - General mailing list archive at Nabble.com.
RE: Exact match syntax [ In reply to ]
Off the top of my head I would guess that audio_slideshow is being tokenized
into audio and slideshow. You may have to adjust the analyzer, but it might
be easier just to redefine your field values so that the analyzer doesn't
separate them.

Sincerely,
James Ryley
http://www.FreePatentsOnline.com

> -----Original Message-----
> From: darkling235 [mailto:darkling235@aol.com]
> Sent: Thursday, January 17, 2008 2:47 PM
> To: general@lucene.apache.org
> Subject: Exact match syntax
>
>
> Lucene has been working well for us until the last few days when we hit a
> snag.
>
>
> We're trying to build a query to search a multiple value property to see
if
> it contains the value of AUDIO. However there is also a different value
for
> that property called AUDIO_SLIDESHOW. Documents with AUDIO_SLIDESHOW but
not
> AUDIO should NOT get returned by this query.
>
>
>
> Just to make it more complicated it is possible a document has both an
AUDIO
> value AND an AUDIO_SLIDESHOW value for that property. In this case the
> document should be returned.
>
> So this property could be
> property:AUDIO (RETURNED)
> property:AUDIO_SLIDESHOW (NOT RETURNED)
> property:AUDIO, AUDIO_SLIDESHOW (RETURNED)
>
>
> Can anyone think of a query syntax that will allow us to get all documents
> with AUDIO in that property but not AUDIO_SLIDESHOW?
>
> Is it possible to build a generic query to do this or do I need to do some
> java programming?
>
> Any advice would be great
> Thanks
> --
> View this message in context: http://www.nabble.com/Exact-match-syntax-
> tp14930762p14930762.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
Re: Exact match syntax [ In reply to ]
This may be a foolish question but if I tell Alfresco (which is what I am
using by the way) to not tokenize this property field, it will save the
results as a single string. In that case when I use lucene to search it will
it really match AUDIO if AUDIO is in the string and not AUDIO_SLIDESHOW?

I was worried that if the string was AUDIO, AUDIO_SLIDESHOW a search might
not match against anything except AUDIO, AUDIOSLIDESHOW being searched for.
I'll give it a try.

Thanks

I'll give it a try.

darkling235 wrote:
>
> Lucene has been working well for us until the last few days when we hit a
> snag.
>
>
> We're trying to build a query to search a multiple value property to see
> if it contains the value of AUDIO. However there is also a different value
> for that property called AUDIO_SLIDESHOW. Documents with AUDIO_SLIDESHOW
> but not AUDIO should NOT get returned by this query.
>
>
>
> Just to make it more complicated it is possible a document has both an
> AUDIO value AND an AUDIO_SLIDESHOW value for that property. In this case
> the document should be returned.
>
> So this property could be
> property:AUDIO (RETURNED)
> property:AUDIO_SLIDESHOW (NOT RETURNED)
> property:AUDIO, AUDIO_SLIDESHOW (RETURNED)
>
>
> Can anyone think of a query syntax that will allow us to get all documents
> with AUDIO in that property but not AUDIO_SLIDESHOW?
>
> Is it possible to build a generic query to do this or do I need to do some
> java programming?
>
> Any advice would be great
> Thanks
>

--
View this message in context: http://www.nabble.com/Exact-match-syntax-tp14930762p14949384.html
Sent from the Lucene - General mailing list archive at Nabble.com.
Re: Exact match syntax [ In reply to ]
That seems to have worked. Thank You

darkling235 wrote:
>
> Lucene has been working well for us until the last few days when we hit a
> snag.
>
>
> We're trying to build a query to search a multiple value property to see
> if it contains the value of AUDIO. However there is also a different value
> for that property called AUDIO_SLIDESHOW. Documents with AUDIO_SLIDESHOW
> but not AUDIO should NOT get returned by this query.
>
>
>
> Just to make it more complicated it is possible a document has both an
> AUDIO value AND an AUDIO_SLIDESHOW value for that property. In this case
> the document should be returned.
>
> So this property could be
> property:AUDIO (RETURNED)
> property:AUDIO_SLIDESHOW (NOT RETURNED)
> property:AUDIO, AUDIO_SLIDESHOW (RETURNED)
>
>
> Can anyone think of a query syntax that will allow us to get all documents
> with AUDIO in that property but not AUDIO_SLIDESHOW?
>
> Is it possible to build a generic query to do this or do I need to do some
> java programming?
>
> Any advice would be great
> Thanks
>

--
View this message in context: http://www.nabble.com/Exact-match-syntax-tp14930762p14949389.html
Sent from the Lucene - General mailing list archive at Nabble.com.