lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aruna Raghavan <Aru...@opin.com>
Subject RE: Term
Date Wed, 27 Mar 2002 19:31:46 GMT
Ype,
Thanks for the response. I think the reason my search worked was because
"object number" got indexed as "object" and the searcher searched for
"object" as well.

-----Original Message-----
From: ykingma@xs4all.nl [mailto:ykingma@xs4all.nl]
Sent: Wednesday, March 27, 2002 1:31 PM
To: lucene-user@jakarta.apache.org
Subject: Re: Term


Aruna,

> Hi,
> While adding documents using something like the following-
> document.add(Field.Text("object number", m_strObjectNumber));
> I used a string "object number" as you can see. I can not find the 
> values for "object number" when I do a search. I am using a
> StandardAnalyzer. Any idea why this is happening?

You would need to pose a query like this

object number:54321

However this is parsed by the standard analyzer  as a query looking
for the term 'object' in the default field and looking
for the term '54321' in the field named 'number'.

There are three workarounds:
- change your fieldname to eg. objectnumber, and query by:
  objectnumber:54321
- use 'object number' as the default field for searching.
- construct the query without using the standard analyzer.

I think the best solution would be to change the fieldname
into something shorter like 'onr' which allows for easy querying.


Regards,
Ype



--
To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message