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 Rob Outar <ro...@ideorlando.org> on 2002/11/14 19:36:19 UTC
Not getting any results from query
Hello all,
I am storing the field in this fashion:
doc.add(new Field("releaseability", releaseability, true, true,
false));
so it is indexed and stored but not tokenized.
The value is "Test Releaseability";
I am using the query releaseability:test releaseability
I am not getting any results, is my query wrong?
Let me know.
Thanks,
Rob
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Not getting any results from query
Posted by Ype Kingma <yk...@xs4all.nl>.
On Friday 15 November 2002 14:40, Rob Outar wrote:
> That is exactly what is happening, I was using the QueryParser class
> because I wanted to do stuff like this:
>
> field1 = value and field2 = value2 or field2 = value3
>
> But from what you are telling me I cannot use the Query Parser class
> because it tokenizes my queries? Do I need to use a different analyzer?
I don't know precisely how the query parser deals with term values.
However, a space normally splits query terms.
The role of the query parser is to find the global structure of the query.
The term values it finds will be passed to the analyzer used in constructing
the query.
Since you constructed the term without an analyzer (you use a non tokenized
field), you might also not want to use an analyzer when constructing a query
for that field.
> The classes that extend Query I don't believe I can use because you cannot
> specify and and or's for those queries. The MultiTermQuery class I do not
> believe I can specify and and or's for the various terms.
The BooleanQuery class allows for required and optional terms iirc,
and a term consists of a field name and a field value.
Have fun,
Ype
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Not getting any results from query
Posted by Peter Carlson <ca...@bookandhammer.com>.
Hi Rob,
I don't know if you already know this, but you can use the query syntax
field1:value AND field2:value2 OR field2:value3
Depending on your desired results you may want to put parens around the
appropriate grouping of terms.
To search for multiple terms in the same field you can use
field1:(value OR value3) AND field2:value2
This will look for both value or value3 in field1
If you are looking for a phrase
field1:"Test reliability"
will also search for the two words (next to each other) in field1.
I hope this helps clarify what the queryParser can do.
--Peter
On Friday, November 15, 2002, at 05:40 AM, Rob Outar wrote:
> That is exactly what is happening, I was using the QueryParser class
> because
> I wanted to do stuff like this:
>
> field1 = value and field2 = value2 or field2 = value3
>
> But from what you are telling me I cannot use the Query Parser class
> because
> it tokenizes my queries? Do I need to use a different analyzer?
>
> The classes that extend Query I don't believe I can use because you
> cannot
> specify and and or's for those queries. The MultiTermQuery class I do
> not
> believe I can specify and and or's for the various terms.
>
> Thanks for all the answers, as always any help is appreciated,
>
> Rob
>
> -----Original Message-----
> From: Ype Kingma [mailto:ykingma@xs4all.nl]
> Sent: Thursday, November 14, 2002 2:52 PM
> To: Lucene Users List
> Subject: Re: Not getting any results from query
>
>
> On Thursday 14 November 2002 19:36, you wrote:
>> Hello all,
>>
>> I am storing the field in this fashion:
>>
>> doc.add(new Field("releaseability", releaseability, true,
>> true,
>> false));
>>
>> so it is indexed and stored but not tokenized.
>>
>> The value is "Test Releaseability";
>>
>> I am using the query releaseability:test releaseability
>>
>> I am not getting any results, is my query wrong?
>
> Yes.
> The field is indexed, but not tokenized. That means that the
> value of the field will be indexed as given: "Test Releaseability".
> To query this, you need to make sure that the queried value is
> not tokenized either, ie. the query should not use an analyzer
> for the field values.
> The space in the field value conflicts with the query parser, ie.
> you can't use a parsed query to query a value containing a space.
>
> However, in case your query analyzer does not put values in lower case
> this query should match:
>
> releaseability:Test*
>
> Lots of fun here: spaces, query analyzers, query parsers, upper/lower
> case,
> and truncation.
>
> You'll have to construct the query yourself in case you want to query
> with
> the whole string "Test Releaseability".
>
> Regards,
> Ype
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Not getting any results from query
Posted by Rob Outar <ro...@ideorlando.org>.
That is exactly what is happening, I was using the QueryParser class because
I wanted to do stuff like this:
field1 = value and field2 = value2 or field2 = value3
But from what you are telling me I cannot use the Query Parser class because
it tokenizes my queries? Do I need to use a different analyzer?
The classes that extend Query I don't believe I can use because you cannot
specify and and or's for those queries. The MultiTermQuery class I do not
believe I can specify and and or's for the various terms.
Thanks for all the answers, as always any help is appreciated,
Rob
-----Original Message-----
From: Ype Kingma [mailto:ykingma@xs4all.nl]
Sent: Thursday, November 14, 2002 2:52 PM
To: Lucene Users List
Subject: Re: Not getting any results from query
On Thursday 14 November 2002 19:36, you wrote:
> Hello all,
>
> I am storing the field in this fashion:
>
> doc.add(new Field("releaseability", releaseability, true, true,
> false));
>
> so it is indexed and stored but not tokenized.
>
> The value is "Test Releaseability";
>
> I am using the query releaseability:test releaseability
>
> I am not getting any results, is my query wrong?
Yes.
The field is indexed, but not tokenized. That means that the
value of the field will be indexed as given: "Test Releaseability".
To query this, you need to make sure that the queried value is
not tokenized either, ie. the query should not use an analyzer
for the field values.
The space in the field value conflicts with the query parser, ie.
you can't use a parsed query to query a value containing a space.
However, in case your query analyzer does not put values in lower case
this query should match:
releaseability:Test*
Lots of fun here: spaces, query analyzers, query parsers, upper/lower case,
and truncation.
You'll have to construct the query yourself in case you want to query with
the whole string "Test Releaseability".
Regards,
Ype
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Not getting any results from query
Posted by Ype Kingma <yk...@xs4all.nl>.
On Thursday 14 November 2002 19:36, you wrote:
> Hello all,
>
> I am storing the field in this fashion:
>
> doc.add(new Field("releaseability", releaseability, true, true,
> false));
>
> so it is indexed and stored but not tokenized.
>
> The value is "Test Releaseability";
>
> I am using the query releaseability:test releaseability
>
> I am not getting any results, is my query wrong?
Yes.
The field is indexed, but not tokenized. That means that the
value of the field will be indexed as given: "Test Releaseability".
To query this, you need to make sure that the queried value is
not tokenized either, ie. the query should not use an analyzer
for the field values.
The space in the field value conflicts with the query parser, ie.
you can't use a parsed query to query a value containing a space.
However, in case your query analyzer does not put values in lower case
this query should match:
releaseability:Test*
Lots of fun here: spaces, query analyzers, query parsers, upper/lower case,
and truncation.
You'll have to construct the query yourself in case you want to query with
the whole string "Test Releaseability".
Regards,
Ype
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Not getting any results from query
Posted by Rob Outar <ro...@ideorlando.org>.
I did not get any results from that query either, seems with the below that
text value string was tokenized. According to what I specified in the field
it should not have been tokenized. I tried to use the example query:
author:"bob dobbs"
figuring that if you are searching for a set of strings that it had to be
quotes, but that did not work either....
Thanks,
Rob Outar
OneSAF A&I -- SAIC
Software\Data Engineer
321-235-7660
outarr@saic.com <ma...@saic.com>
-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
Sent: Thursday, November 14, 2002 2:43 PM
To: Lucene Users List
Subject: Re: Not getting any results from query
Try searching for:
+releaseability:Test +releaseability:Releaseability
Otis
--- Rob Outar <ro...@ideorlando.org> wrote:
> Hello all,
>
> I am storing the field in this fashion:
>
> doc.add(new Field("releaseability", releaseability, true,
> true,
> false));
>
> so it is indexed and stored but not tokenized.
>
> The value is "Test Releaseability";
>
> I am using the query releaseability:test releaseability
>
> I am not getting any results, is my query wrong?
>
> Let me know.
>
> Thanks,
>
> Rob
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Not getting any results from query
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Try searching for:
+releaseability:Test +releaseability:Releaseability
Otis
--- Rob Outar <ro...@ideorlando.org> wrote:
> Hello all,
>
> I am storing the field in this fashion:
>
> doc.add(new Field("releaseability", releaseability, true,
> true,
> false));
>
> so it is indexed and stored but not tokenized.
>
> The value is "Test Releaseability";
>
> I am using the query releaseability:test releaseability
>
> I am not getting any results, is my query wrong?
>
> Let me know.
>
> Thanks,
>
> Rob
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>