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 Robert Young <bu...@gmail.com> on 2007/10/15 16:43:08 UTC
Querying for an id with a colon in it
Hi,
If my unique identifier is called guid and one of the ids in it is,
for example, "article:123". How can I query for that article id? I
have tried a number of ways but I always either get no results or an
error. It seems to be to do with having the colon in the id value.
eg.
?q=guid:article:123 -> error
?q=guid:"article:123" -> error
?q=guid:article%3A123 -> error
Any ideas?
Cheers
Rob
Re: Querying for an id with a colon in it
Posted by Robert Young <bu...@gmail.com>.
Hey,
Thanks Brian, that works perfectly.
Cheers
Rob
On 10/15/07, Brian Carmalt <bc...@contact.de> wrote:
> Robert Young schrieb:
> > Hi,
> >
> > If my unique identifier is called guid and one of the ids in it is,
> > for example, "article:123". How can I query for that article id? I
> > have tried a number of ways but I always either get no results or an
> > error. It seems to be to do with having the colon in the id value.
> >
> > eg.
> > ?q=guid:article:123 -> error
> > ?q=guid:"article:123" -> error
> > ?q=guid:article%3A123 -> error
> >
> > Any ideas?
> > Cheers
> > Rob
> >
> >
> Try it with a \: That's what the Lucene Query Parser Syntax page says.
> It doesn't cause an error, but I don't know if it will provide the
> results you want.
>
> Brian
>
Re: Querying for an id with a colon in it
Posted by Chris Hostetter <ho...@fucit.org>.
: > ?q=guid:"article:123" -> error
i would really like to know what error you got from that query ... it is
not only valid, but it should also get you the same results as back-slash
escaping the colon.
(both are working for me right now ... which version of Solr are you
using?)
-Hoss
Re: Querying for an id with a colon in it
Posted by Brian Carmalt <bc...@contact.de>.
Robert Young schrieb:
> Hi,
>
> If my unique identifier is called guid and one of the ids in it is,
> for example, "article:123". How can I query for that article id? I
> have tried a number of ways but I always either get no results or an
> error. It seems to be to do with having the colon in the id value.
>
> eg.
> ?q=guid:article:123 -> error
> ?q=guid:"article:123" -> error
> ?q=guid:article%3A123 -> error
>
> Any ideas?
> Cheers
> Rob
>
>
Try it with a \: That's what the Lucene Query Parser Syntax page says.
It doesn't cause an error, but I don't know if it will provide the
results you want.
Brian